diff options
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2683,12 +2683,12 @@ BlockDriverState *bdrv_lookup_bs(const char *device, blk = blk_by_name(device); if (blk) { - if (!blk_bs(blk)) { + bs = blk_bs(blk); + if (!bs) { error_setg(errp, "Device '%s' has no medium", device); - return NULL; } - return blk_bs(blk); + return bs; } } |