diff options
author | Michael Knudsen <mk@cvs.openbsd.org> | 2011-06-17 07:06:48 +0000 |
---|---|---|
committer | Michael Knudsen <mk@cvs.openbsd.org> | 2011-06-17 07:06:48 +0000 |
commit | 588580a3636f1d2f89071c40a24811393a93accc (patch) | |
tree | fe14f36309c4c36297658840fbee97ea66114ab6 /sys/nnpfs/nnpfs_vnodeops-common.c | |
parent | f54f5c33e3808aca4c742c69b64f7a9619f240cb (diff) |
M_WAITOK cleanup of two cases:
1) Allocating with M_WAITOK, checking for NULL, and calling panic() is
pointless (malloc() will panic if it can't allocate) so remove the check
and the call.
2) Allocating with M_WAITOK, checking for NULL, and then gracefully
handling failure to allocate is pointless. Instead also pass M_CANFAIL
so malloc() doesn't panic so we can actually handle it gracefully.
1) was done using Coccinelle.
Input from oga.
ok miod.
Diffstat (limited to 'sys/nnpfs/nnpfs_vnodeops-common.c')
-rw-r--r-- | sys/nnpfs/nnpfs_vnodeops-common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/nnpfs/nnpfs_vnodeops-common.c b/sys/nnpfs/nnpfs_vnodeops-common.c index fa01d81932a..c46539d18d2 100644 --- a/sys/nnpfs/nnpfs_vnodeops-common.c +++ b/sys/nnpfs/nnpfs_vnodeops-common.c @@ -931,7 +931,7 @@ nnpfs_symlink_common(struct vnode *dvp, NNPFSDEB(XDEBVNOPS, ("nnpfs_symlink: %s\n", name)); - msg = malloc(sizeof(*msg), M_TEMP, M_WAITOK | M_ZERO); + msg = malloc(sizeof(*msg), M_TEMP, M_WAITOK | M_CANFAIL | M_ZERO); if (msg == NULL) { error = ENOMEM; goto done; |