char **vendor_string,
char **product_string)
{
- int ret = -1, pciret;
+ int ret = -1;
struct pci_id_match m;
const char *vendor_name = NULL, *device_name = NULL;
- if ((pciret = pci_system_init()) != 0) {
- char ebuf[256];
- VIR_INFO("Failed to initialize libpciaccess: %s",
- virStrerror(pciret, ebuf, sizeof ebuf));
- ret = 0;
- goto out;
- }
-
m.vendor_id = vendor;
m.device_id = product;
m.subvendor_id = PCI_MATCH_ANY;
}
}
- /* pci_system_cleanup returns void */
- pci_system_cleanup();
-
ret = 0;
out:
ret = -1;
}
+ /* pci_system_cleanup returns void */
+ pci_system_cleanup();
+
return ret;
}
udevPrivate *priv = NULL;
struct udev *udev = NULL;
int ret = 0;
+ int pciret;
+
+ if ((pciret = pci_system_init()) != 0) {
+ char ebuf[256];
+ VIR_INFO("Failed to initialize libpciaccess: %s",
+ virStrerror(pciret, ebuf, sizeof ebuf));
+ ret = -1;
+ goto out;
+ }
if (VIR_ALLOC(priv) < 0) {
virReportOOMError();