diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2001-05-16 12:48:33 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2001-05-16 12:48:33 +0000 |
commit | 6585d4db5e5404b845849f5e9fe0d623c62cfd22 (patch) | |
tree | 75800e56e16cae6b5e9c3de41d5c5b2756680841 /sys/nfs | |
parent | 5bc24a1bb212a40743a45a2d5234a746c83746c2 (diff) |
No need to check M_WAIT/M_WAITOK malloc return values. (art@ ok)
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/krpc_subr.c | 29 | ||||
-rw-r--r-- | sys/nfs/nfs_vfsops.c | 4 |
2 files changed, 8 insertions, 25 deletions
diff --git a/sys/nfs/krpc_subr.c b/sys/nfs/krpc_subr.c index fb8ec0cb94b..817f95010e6 100644 --- a/sys/nfs/krpc_subr.c +++ b/sys/nfs/krpc_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: krpc_subr.c,v 1.9 1998/02/28 14:03:08 deraadt Exp $ */ +/* $OpenBSD: krpc_subr.c,v 1.10 2001/05/16 12:48:32 ho Exp $ */ /* $NetBSD: krpc_subr.c,v 1.12.4.1 1996/06/07 00:52:26 cgd Exp $ */ /* @@ -153,8 +153,6 @@ krpc_portmap(sin, prog, vers, portp) } m = m_get(M_WAIT, MT_DATA); - if (m == NULL) - return ENOBUFS; sdata = mtod(m, struct sdata *); m->m_len = sizeof(*sdata); @@ -204,6 +202,7 @@ krpc_call(sa, prog, vers, func, data, from_p) static u_int32_t xid = 0; u_int32_t newxid; int *ip; + struct timeval *tv; /* * Validate address family. @@ -223,18 +222,12 @@ krpc_call(sa, prog, vers, func, data, from_p) goto out; m = m_get(M_WAIT, MT_SOOPTS); - if (m == NULL) { - error = ENOBUFS; + tv = mtod(m, struct timeval *); + m->m_len = sizeof(*tv); + tv->tv_sec = 1; + tv->tv_usec = 0; + if ((error = sosetopt(so, SOL_SOCKET, SO_RCVTIMEO, m))) goto out; - } else { - struct timeval *tv; - tv = mtod(m, struct timeval *); - m->m_len = sizeof(*tv); - tv->tv_sec = 1; - tv->tv_usec = 0; - if ((error = sosetopt(so, SOL_SOCKET, SO_RCVTIMEO, m))) - goto out; - } /* * Enable broadcast if necessary. @@ -242,10 +235,6 @@ krpc_call(sa, prog, vers, func, data, from_p) if (from_p) { int32_t *on; m = m_get(M_WAIT, MT_SOOPTS); - if (m == NULL) { - error = ENOBUFS; - goto out; - } on = mtod(m, int32_t *); m->m_len = sizeof(*on); *on = 1; @@ -297,10 +286,6 @@ krpc_call(sa, prog, vers, func, data, from_p) * Setup socket address for the server. */ nam = m_get(M_WAIT, MT_SONAME); - if (nam == NULL) { - error = ENOBUFS; - goto out; - } sin = mtod(nam, struct sockaddr_in *); bcopy((caddr_t)sa, (caddr_t)sin, (nam->m_len = sa->sin_len)); diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index 3640ed142e4..3a43c37a635 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vfsops.c,v 1.32 2001/02/20 01:50:11 assar Exp $ */ +/* $OpenBSD: nfs_vfsops.c,v 1.33 2001/05/16 12:48:32 ho Exp $ */ /* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */ /* @@ -418,8 +418,6 @@ nfs_mount_diskless(ndmntp, mntname, mntflag, vpp) /* Get mbuf for server sockaddr. */ m = m_get(M_WAIT, MT_SONAME); - if (m == NULL) - panic("nfs_mountroot: mget soname for %s", mntname); bcopy((caddr_t)args.addr, mtod(m, caddr_t), (m->m_len = args.addr->sa_len)); |