From 7d7f09674bd0f6b0a587ec9bc977d8828a4c74aa Mon Sep 17 00:00:00 2001 From: bdrewery Date: Thu, 29 Oct 2015 19:02:24 +0000 Subject: [PATCH] getnewbuf: Initialize bp to avoid uninitialized pointer dereference and brelse(). This came in recently in r289279. Coverity CID: 1331561 --- sys/kern/vfs_bio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 4cc9a4ed1889..0f1f882eeabf 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -2885,6 +2885,7 @@ getnewbuf(struct vnode *vp, int slpflag, int slptimeo, int maxsize, int gbflags) 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)