]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block: Remove NULL check in bdrv_co_flush
authorFam Zheng <famz@redhat.com>
Wed, 26 Apr 2017 02:03:49 +0000 (10:03 +0800)
committerKevin Wolf <kwolf@redhat.com>
Thu, 27 Apr 2017 13:39:50 +0000 (15:39 +0200)
Reported by Coverity. We already use bs in bdrv_inc_in_flight before
checking for NULL. It is unnecessary as all callers pass non-NULL bs, so
drop it.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/io.c

index a32fd1d9e59248a741db5ae97df74d55fa0a9d61..80d6c62a85ffbe4ff6596d2ac11576ff26143d8c 100644 (file)
@@ -2300,7 +2300,7 @@ int coroutine_fn bdrv_co_flush(BlockDriverState *bs)
 
     bdrv_inc_in_flight(bs);
 
-    if (!bs || !bdrv_is_inserted(bs) || bdrv_is_read_only(bs) ||
+    if (!bdrv_is_inserted(bs) || bdrv_is_read_only(bs) ||
         bdrv_is_sg(bs)) {
         goto early_exit;
     }