Fix panic if FIOASYNC callback is registered and triggered without target

PiperOrigin-RevId: 215674589
Change-Id: I4f8871b64c570dc6da448d2fe351cec8a406efeb
This commit is contained in:
Ian Gudger 2018-10-03 20:21:25 -07:00 committed by Shentubot
parent e98b14b4aa
commit beac59b37a
1 changed files with 5 additions and 0 deletions

View File

@ -60,6 +60,11 @@ func (a *FileAsync) Callback(e *waiter.Entry) {
if tg != nil {
t = tg.Leader()
}
if t == nil {
// No recipient has been registered.
a.mu.Unlock()
return
}
c := t.Credentials()
// Logic from sigio_perm in fs/fcntl.c.
if a.requester.EffectiveKUID == 0 ||