summaryrefslogtreecommitdiffstats
path: root/sys/nfs
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>1999-09-29 20:12:39 +0000
committermarcel <marcel@FreeBSD.org>1999-09-29 20:12:39 +0000
commita77102446a7ed62892f4629f29c32047c3d43b72 (patch)
treec9e408177fc280914b661060693cf41b5d30699e /sys/nfs
parentd4e70391772e9b3fa25d96b93d50278ea1c125ef (diff)
downloadFreeBSD-src-a77102446a7ed62892f4629f29c32047c3d43b72.zip
FreeBSD-src-a77102446a7ed62892f4629f29c32047c3d43b72.tar.gz
Careless use of struct proc *p caused major problems. 'p' is allowed to
be NULL in this function (nfs_sigintr). Reorder the statements and guard them all with a single if (p != NULL). reported, reviewed and tested by: jdp
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_socket.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index 9434fb9..f7204b5 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1504,15 +1504,19 @@ nfs_sigintr(nmp, rep, p)
{
sigset_t tmpset;
- tmpset = p->p_siglist;
- SIGSETNAND(tmpset, p->p_sigmask);
- SIGSETNAND(tmpset, p->p_sigignore);
if (rep && (rep->r_flags & R_SOFTTERM))
return (EINTR);
if (!(nmp->nm_flag & NFSMNT_INT))
return (0);
- if (p && SIGNOTEMPTY(p->p_siglist) && NFSINT_SIGMASK(tmpset))
+ if (p == NULL)
+ return (0);
+
+ tmpset = p->p_siglist;
+ SIGSETNAND(tmpset, p->p_sigmask);
+ SIGSETNAND(tmpset, p->p_sigignore);
+ if (SIGNOTEMPTY(p->p_siglist) && NFSINT_SIGMASK(tmpset))
return (EINTR);
+
return (0);
}
OpenPOWER on IntegriCloud