]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
getnewbuf: Initialize bp to avoid uninitialized pointer dereference and brelse().
authorbdrewery <bdrewery@FreeBSD.org>
Thu, 29 Oct 2015 19:02:24 +0000 (19:02 +0000)
committerbdrewery <bdrewery@FreeBSD.org>
Thu, 29 Oct 2015 19:02:24 +0000 (19:02 +0000)
This came in recently in r289279.

Coverity CID: 1331561

sys/kern/vfs_bio.c

index 4cc9a4ed1889821dae3182de45cdc246e196402e..0f1f882eeabfbfaddb006727b0a8a05e95529243 100644 (file)
@@ -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)