Skip to content

Commit

Permalink
block: Remove NULL check in bdrv_co_flush
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fam Zheng authored and kevmw committed Apr 27, 2017
1 parent 242e496 commit e914404
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/io.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit e914404

Please sign in to comment.