[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/21] commit: Add NULL check for overlay_bs
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 01/21] commit: Add NULL check for overlay_bs |
Date: |
Tue, 18 Jul 2017 16:17:46 +0200 |
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: address@hidden
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
block/commit.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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. */
--
1.8.3.1
- [Qemu-devel] [PULL 00/21] Block layer patches, Kevin Wolf, 2017/07/18
- [Qemu-devel] [PULL 01/21] commit: Add NULL check for overlay_bs,
Kevin Wolf <=
- [Qemu-devel] [PULL 02/21] block: add clock_type field to ThrottleGroup, Kevin Wolf, 2017/07/18
- [Qemu-devel] [PULL 03/21] block: remove timer canceling in throttle_config(), Kevin Wolf, 2017/07/18
- [Qemu-devel] [PULL 04/21] block/vmdk: Report failures in vmdk_read_cid(), Kevin Wolf, 2017/07/18
- [Qemu-devel] [PULL 05/21] block/vpc.c: Handle write failures in get_image_offset(), Kevin Wolf, 2017/07/18
- [Qemu-devel] [PULL 09/21] block/qapi: Use blk_all_next() for query-block, Kevin Wolf, 2017/07/18
- [Qemu-devel] [PULL 08/21] block: Make blk_all_next() public, Kevin Wolf, 2017/07/18
- [Qemu-devel] [PULL 07/21] block/qapi: Add qdev device name to query-block, Kevin Wolf, 2017/07/18
- [Qemu-devel] [PULL 06/21] block: Make blk_get_attached_dev_id() public, Kevin Wolf, 2017/07/18
- [Qemu-devel] [PULL 10/21] block: List anonymous device BBs in query-block, Kevin Wolf, 2017/07/18
- [Qemu-devel] [PULL 11/21] ide: bdrv_attach_dev() for empty CD-ROM, Kevin Wolf, 2017/07/18