From: Marc Hartmayer <mhartmay(a)linux.vnet.ibm.com>
As the switch statement checks data.type of the iterator variable @cap
it must use this variable for the update too.
Suggested-by: Bjoern Walk <bwalk(a)linux.vnet.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.vnet.ibm.com>
---
src/node_device/node_device_driver.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index ba3da6288..002c7616f 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -54,7 +54,7 @@ static int update_caps(virNodeDeviceObjPtr dev)
while (cap) {
switch (cap->data.type) {
case VIR_NODE_DEV_CAP_SCSI_HOST:
-
nodeDeviceSysfsGetSCSIHostCaps(&dev->def->caps->data.scsi_host);
+ nodeDeviceSysfsGetSCSIHostCaps(&cap->data.scsi_host);
break;
case VIR_NODE_DEV_CAP_NET:
if (virNetDevGetLinkInfo(cap->data.net.ifname, &cap->data.net.lnk)
< 0)
@@ -65,7 +65,7 @@ static int update_caps(virNodeDeviceObjPtr dev)
break;
case VIR_NODE_DEV_CAP_PCI_DEV:
if (nodeDeviceSysfsGetPCIRelatedDevCaps(dev->def->sysfs_path,
-
&dev->def->caps->data.pci_dev) < 0)
+ &cap->data.pci_dev) < 0)
return -1;
break;
--
2.11.2