Skip to contentSkip to conversation

block: Don't call blk_bs() twice in bdrv_lookup_bs()

PATCH Applied Alberto Garcia 2 participants 2 messages Oct 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: Don't call blk_bs() twice in bdrv_lookup_bs()

---
 block.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
block.c +3 -3
index e9f40dc..eb8158a 100644
@@ -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;
         }
     }
 
Signature · 1 line
2.6.1