diff options
author | jeff <jeff@FreeBSD.org> | 2007-12-31 03:44:54 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2007-12-31 03:44:54 +0000 |
commit | 319a3672d92c6d82c288be6465709154b2cbb64e (patch) | |
tree | 8984eb828e6be88cf8850103c437e62460058be1 | |
parent | a836858474cf06343a6120752c21fcc279070190 (diff) | |
download | FreeBSD-src-319a3672d92c6d82c288be6465709154b2cbb64e.zip FreeBSD-src-319a3672d92c6d82c288be6465709154b2cbb64e.tar.gz |
- Check the correct variable against NULL in two places.
- If the unp_file is NULL that means it has never been internalized and it
must be reachable.
-rw-r--r-- | sys/kern/uipc_usrreq.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 1d6cc46..2f2b763 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1916,8 +1916,7 @@ unp_accessable(struct file *fp) { struct unpcb *unp; - unp = fptounp(fp); - if (fp == NULL) + if ((unp = fptounp(fp)) == NULL) return; if (unp->unp_gcflag & UNPGC_REF) return; @@ -1942,8 +1941,7 @@ unp_gc_process(struct unpcb *unp) * queue as indicated by msgcount, and this must equal the file * reference count. Note that when msgcount is 0 the file is NULL. */ - if (unp->unp_msgcount != 0 && fp->f_count != 0 && - fp->f_count == unp->unp_msgcount) { + if (fp && fp->f_count != 0 && fp->f_count == unp->unp_msgcount) { unp->unp_gcflag |= UNPGC_DEAD; unp_unreachable++; return; |