summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2013-08-09 08:40:31 +0000
committertrasz <trasz@FreeBSD.org>2013-08-09 08:40:31 +0000
commitfcb31f05a939358e510816e46ff7729b2ffd94da (patch)
tree2185401ca3d84aaa25bb13deffb7091ac427d759
parent9d86b16a9e419dce7efd57b0d1465200c8b5a218 (diff)
downloadFreeBSD-src-fcb31f05a939358e510816e46ff7729b2ffd94da.zip
FreeBSD-src-fcb31f05a939358e510816e46ff7729b2ffd94da.tar.gz
Don't dereference null pointer should acl_alloc() be passed M_NOWAIT
and allocation failed. Nothing in the tree passed M_NOWAIT. Obtained from: mjg MFC after: 1 month
-rw-r--r--sys/kern/vfs_acl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c
index cc8f682..1c9923d 100644
--- a/sys/kern/vfs_acl.c
+++ b/sys/kern/vfs_acl.c
@@ -540,6 +540,9 @@ acl_alloc(int flags)
struct acl *aclp;
aclp = malloc(sizeof(*aclp), M_ACL, flags);
+ if (aclp == NULL)
+ return (NULL);
+
aclp->acl_maxcnt = ACL_MAX_ENTRIES;
return (aclp);
OpenPOWER on IntegriCloud