]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
node_device: pacify grumpy coverity due to addr override
authorBoris Fiuczynski <fiuczy@linux.ibm.com>
Thu, 10 Dec 2020 17:32:36 +0000 (18:32 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 14 Dec 2020 11:12:08 +0000 (12:12 +0100)
With commit 09364608b4 node_device: refactor address retrieval of node device
"if-else if" was replaced by "switch".
The contained break statement now is no longer in context of the for loop
but instead of the switch causing the legitimate grumpiness of coverity.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Suggested-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/node_device/node_device_driver.c

index e254b49244fbd636f1c618cdd743054ea4482c36..51b20848ce87fa8de26d68db11b56f20a82749e3 100644 (file)
@@ -687,6 +687,9 @@ nodeDeviceFindAddressByName(const char *name)
         case VIR_NODE_DEV_CAP_LAST:
             break;
         }
+
+        if (addr)
+            break;
     }
 
     virNodeDeviceObjEndAPI(&dev);