[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 15/15] block/qapi: Remove redundant NULL check to sil
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 15/15] block/qapi: Remove redundant NULL check to silence Coverity |
Date: |
Tue, 1 Aug 2017 16:46:32 +0200 |
When skipping implicit nodes in bdrv_block_device_info(), we know that
bs0 is always non-NULL; initially, because it's taken from a BdrvChild
and a BdrvChild never has a NULL bs, and after the first iteration
because implicit nodes always have a backing file.
Remove the NULL check and add an assertion that the implicit node does
indeed have a backing file.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>
---
block/qapi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/qapi.c b/block/qapi.c
index d2b18ee9df..5f1a71f5d2 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -145,8 +145,9 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk,
/* Skip automatically inserted nodes that the user isn't aware of for
* query-block (blk != NULL), but not for query-named-block-nodes */
- while (blk && bs0 && bs0->drv && bs0->implicit) {
+ while (blk && bs0->drv && bs0->implicit) {
bs0 = backing_bs(bs0);
+ assert(bs0);
}
}
--
2.13.3
- [Qemu-devel] [PULL 06/15] block: fix dangling bs->explicit_options in block.c, (continued)
- [Qemu-devel] [PULL 06/15] block: fix dangling bs->explicit_options in block.c, Kevin Wolf, 2017/08/01
- [Qemu-devel] [PULL 04/15] iotests: Check dirty bitmap statistics in 124, Kevin Wolf, 2017/08/01
- [Qemu-devel] [PULL 05/15] iotests: Add test of recent fix to 'qemu-img measure', Kevin Wolf, 2017/08/01
- [Qemu-devel] [PULL 07/15] block: fix leaks in bdrv_open_driver(), Kevin Wolf, 2017/08/01
- [Qemu-devel] [PULL 09/15] qemu-iotests: Remove blkdebug.conf after tests, Kevin Wolf, 2017/08/01
- [Qemu-devel] [PULL 13/15] qemu-iotests/063: Fix leaked image, Kevin Wolf, 2017/08/01
- [Qemu-devel] [PULL 10/15] qemu-iotests/141: Fix image cleanup, Kevin Wolf, 2017/08/01
- [Qemu-devel] [PULL 11/15] qemu-iotests/153: Fix leaked scratch images, Kevin Wolf, 2017/08/01
- [Qemu-devel] [PULL 08/15] qemu-iotests/041: Fix leaked scratch images, Kevin Wolf, 2017/08/01
- [Qemu-devel] [PULL 12/15] qemu-iotests/162: Fix leaked temporary files, Kevin Wolf, 2017/08/01
- [Qemu-devel] [PULL 15/15] block/qapi: Remove redundant NULL check to silence Coverity,
Kevin Wolf <=
- [Qemu-devel] [PULL 14/15] qemu-iotests/059: Fix leaked image files, Kevin Wolf, 2017/08/01
- [Qemu-devel] [PULL 01/15] docs: add qemu-block-drivers(7) man page, Kevin Wolf, 2017/08/01
- Re: [Qemu-devel] [PULL 00/15] Block layer patches for 2.10.0-rc1, Peter Maydell, 2017/08/01