summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2001-05-16 12:48:33 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2001-05-16 12:48:33 +0000
commit6585d4db5e5404b845849f5e9fe0d623c62cfd22 (patch)
tree75800e56e16cae6b5e9c3de41d5c5b2756680841
parent5bc24a1bb212a40743a45a2d5234a746c83746c2 (diff)
No need to check M_WAIT/M_WAITOK malloc return values. (art@ ok)
-rw-r--r--sys/adosfs/advfsops.c5
-rw-r--r--sys/miscfs/procfs/procfs_status.c4
-rw-r--r--sys/nfs/krpc_subr.c29
-rw-r--r--sys/nfs/nfs_vfsops.c4
4 files changed, 11 insertions, 31 deletions
diff --git a/sys/adosfs/advfsops.c b/sys/adosfs/advfsops.c
index f4508f7a029..93c61772029 100644
--- a/sys/adosfs/advfsops.c
+++ b/sys/adosfs/advfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: advfsops.c,v 1.18 2001/02/20 01:50:08 assar Exp $ */
+/* $OpenBSD: advfsops.c,v 1.19 2001/05/16 12:48:31 ho Exp $ */
/* $NetBSD: advfsops.c,v 1.24 1996/12/22 10:10:12 cgd Exp $ */
/*
@@ -243,8 +243,7 @@ adosfs_mountfs(devvp, mp, p)
/* allocate and load bitmap, set free space */
amp->bitmap = malloc(((amp->numblks + 31) / 32) * sizeof(*amp->bitmap),
M_ADOSFSBITMAP, M_WAITOK);
- if (amp->bitmap)
- adosfs_loadbitmap(amp);
+ adosfs_loadbitmap(amp);
if (mp->mnt_flag & MNT_RDONLY && amp->bitmap) {
/*
* Don't need the bitmap any more if it's read-only.
diff --git a/sys/miscfs/procfs/procfs_status.c b/sys/miscfs/procfs/procfs_status.c
index 5865eb0956f..e1d647efea2 100644
--- a/sys/miscfs/procfs/procfs_status.c
+++ b/sys/miscfs/procfs/procfs_status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procfs_status.c,v 1.4 2000/12/18 18:44:28 provos Exp $ */
+/* $OpenBSD: procfs_status.c,v 1.5 2001/05/16 12:48:32 ho Exp $ */
/* $NetBSD: procfs_status.c,v 1.11 1996/03/16 23:52:50 christos Exp $ */
/*
@@ -168,8 +168,6 @@ procfs_dostatus(curp, p, pfs, uio)
len = procfs_stat_gen(p, NULL, 0);
ps = malloc(len, M_TEMP, M_WAITOK);
- if (!ps)
- return (ENOMEM);
(void) procfs_stat_gen(p, ps, len);
len -= uio->uio_offset;
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));