From 8ddc3590ccd6b5e65422aa0b8ad229498adf47aa Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Fri, 9 Aug 2013 08:40:31 +0000 Subject: [PATCH] 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 --- sys/kern/vfs_acl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index cc8f68228a3e..1c9923d9d2a8 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);