From: Michal Privoznik <[email protected]>

Either an error should be returned in all error paths in a
function or in none (leaving it up to caller). Well,
virPCIGetVirtualFunctionIndex() breaks this pattern. Fix it.

Signed-off-by: Michal Privoznik <[email protected]>
---
 src/util/virpci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/virpci.c b/src/util/virpci.c
index 78c47869ef..ca6f2e8210 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -2870,6 +2870,9 @@ virPCIGetVirtualFunctionIndex(const char 
*pf_sysfs_device_link,
         }
     }
 
+    virReportError(VIR_ERR_INTERNAL_ERROR,
+                   _("No virtual function index found for '%1$s'"),
+                   pf_sysfs_device_link);
     return -1;
 }
 
-- 
2.52.0

Reply via email to