diff options
author | Kevin Wolf <kwolf@redhat.com> | 2017-07-10 13:42:35 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-07-18 15:14:35 +0200 |
commit | b1e1fa0c3afc7f671fbc24645bdf67949a5657e5 (patch) | |
tree | a233d96194f1537e30769ab121b97b242ca221aa /block/commit.c | |
parent | 718d7f4f9cf772e5784093d8e6085680a235acdb (diff) | |
download | qemu-b1e1fa0c3afc7f671fbc24645bdf67949a5657e5.zip qemu-b1e1fa0c3afc7f671fbc24645bdf67949a5657e5.tar.gz qemu-b1e1fa0c3afc7f671fbc24645bdf67949a5657e5.tar.bz2 |
commit: Add NULL check for overlay_bs
I can't see how overlay_bs could become NULL with the current code, but
other code in this function already checks it and we can make Coverity
happy with this check, so let's add it.
Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/commit.c')
-rw-r--r-- | block/commit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/block/commit.c b/block/commit.c index 1314360..5cc910f 100644 --- a/block/commit.c +++ b/block/commit.c @@ -90,7 +90,9 @@ static void commit_complete(BlockJob *job, void *opaque) /* Make sure overlay_bs and top stay around until bdrv_set_backing_hd() */ bdrv_ref(top); - bdrv_ref(overlay_bs); + if (overlay_bs) { + bdrv_ref(overlay_bs); + } /* Remove base node parent that still uses BLK_PERM_WRITE/RESIZE before * the normal backing chain can be restored. */ |