Skip to contentSkip to conversation

block: remove dead check

PATCH Applied Paolo Bonzini 3 participants 3 messages Jan 4, 2017 – Jan 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: remove dead check

options must be non-NULL here, because a NULL value is replaced with qdict_new earlier in the function. Reported by Coverity.

---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block.c +1 -1
index 39ddea3..a0346c8 100644
@@ -1851,7 +1851,7 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
     bdrv_refresh_filename(bs);
 
     /* Check if any unknown options were used */
-    if (options && (qdict_size(options) != 0)) {
+    if (qdict_size(options) != 0) {
         const QDictEntry *entry = qdict_first(options);
         if (flags & BDRV_O_PROTOCOL) {
             error_setg(errp, "Block protocol '%s' doesn't support the option "
Signature · 1 line
2.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Paolo Bonzini

options must be non-NULL here, because a NULL value is replaced with qdict_new earlier in the function. Reported by Coverity.

---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
block.c +1 -1
index 39ddea3..a0346c8 100644
@@ -1851,7 +1851,7 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
     bdrv_refresh_filename(bs);
 
     /* Check if any unknown options were used */
-    if (options && (qdict_size(options) != 0)) {
+    if (qdict_size(options) != 0) {
         const QDictEntry *entry = qdict_first(options);
         if (flags & BDRV_O_PROTOCOL) {
             error_setg(errp, "Block protocol '%s' doesn't support the option "
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#2 lore raw
In reply to Paolo Bonzini
Quoted 2 lines · Paolo Bonzini

options must be non-NULL here, because a NULL value is replaced with qdict_new earlier in the function. Reported by Coverity.

Applied to -trivial, thank you!

/mjt