Skip to content
Commit 6d759117 authored by Jeff Cody's avatar Jeff Cody Committed by Stefan Hajnoczi
Browse files

block: fix null-pointer bug on error case in block commit



This is a bug that was caught by a coverity run by Markus.  In
the error case when we errored out to exit_restore_open early in the
function, 'overlay_bs' was still NULL at that point, although it is
used to look up flags and perform a bdrv_reopen().

Move the overlay_bs lookup to where it is needed, and check for NULL
before restoring the flags.  Also get rid of the unneeded parameter
initialization.

Reported-By: default avatarMarkus Armbruster <armbru@redhat.com>
Signed-off-by: default avatarJeff Cody <jcody@redhat.com>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent 47f4dac3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment