diff options
Diffstat (limited to 'block/block-backend.c')
-rw-r--r-- | block/block-backend.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/block/block-backend.c b/block/block-backend.c index b96323f658..bc1f071354 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -152,7 +152,6 @@ BlockBackend *blk_new_open(const char *filename, const char *reference, { BlockBackend *blk; BlockDriverState *bs; - int ret; blk = blk_new(errp); if (!blk) { @@ -160,9 +159,8 @@ BlockBackend *blk_new_open(const char *filename, const char *reference, return NULL; } - bs = NULL; - ret = bdrv_open(&bs, filename, reference, options, flags, errp); - if (ret < 0) { + bs = bdrv_open(filename, reference, options, flags, errp); + if (!bs) { blk_unref(blk); return NULL; } |