Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 2013 08:40:32 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254135 - head/sys/kern
Message-ID:  <201308090840.r798eWGx038174@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Fri Aug  9 08:40:31 2013
New Revision: 254135
URL: http://svnweb.freebsd.org/changeset/base/254135

Log:
  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

Modified:
  head/sys/kern/vfs_acl.c

Modified: head/sys/kern/vfs_acl.c
==============================================================================
--- head/sys/kern/vfs_acl.c	Fri Aug  9 08:38:51 2013	(r254134)
+++ head/sys/kern/vfs_acl.c	Fri Aug  9 08:40:31 2013	(r254135)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308090840.r798eWGx038174>