The return value of rte_pci_read_config should be checked.
Coverity issue: 302860
Fixes:
a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
hw->common_cfg = get_cap_addr(hw, &cap);
break;
case IFCVF_PCI_CAP_NOTIFY_CFG:
- PCI_READ_CONFIG_DWORD(dev, &hw->notify_off_multiplier,
+ ret = PCI_READ_CONFIG_DWORD(dev,
+ &hw->notify_off_multiplier,
pos + sizeof(cap));
+ if (ret < 0) {
+ DEBUGOUT("failed to read notify_off_multiplier\n");
+ return -1;
+ }
hw->notify_base = get_cap_addr(hw, &cap);
hw->notify_region = cap.bar;
break;