svn commit: r290155 - head/sys/kern

Bryan Drewery bdrewery at FreeBSD.org
Thu Oct 29 19:02:26 UTC 2015


Author: bdrewery
Date: Thu Oct 29 19:02:24 2015
New Revision: 290155
URL: https://svnweb.freebsd.org/changeset/base/290155

Log:
  getnewbuf: Initialize bp to avoid uninitialized pointer dereference and brelse().
  
  This came in recently in r289279.
  
  Coverity CID:	1331561

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Thu Oct 29 18:58:18 2015	(r290154)
+++ head/sys/kern/vfs_bio.c	Thu Oct 29 19:02:24 2015	(r290155)
@@ -2885,6 +2885,7 @@ getnewbuf(struct vnode *vp, int slpflag,
 	struct buf *bp;
 	bool metadata, reserved;
 
+	bp = NULL;
 	KASSERT((gbflags & (GB_UNMAPPED | GB_KVAALLOC)) != GB_KVAALLOC,
 	    ("GB_KVAALLOC only makes sense with GB_UNMAPPED"));
 	if (!unmapped_buf_allowed)


More information about the svn-src-head mailing list