Skip to contentSkip to conversation

librte_ether: fix coverity errors

PATCH Applied Bernard Iremonger 2 participants 3 messages Nov 6, 2015 – Nov 10, 2015

lore
Share & tools
lore
#0 lore raw

v2 cover librte_ether: fix coverity errors

Changes in v2:
Add return statement to if branch instead of an else branch.

Bernard Iremonger (1):
librte_ether: fix coverity errors in rte_eth_copy_pci_info

 lib/librte_ether/rte_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 librte_ether: fix coverity errors in rte_eth_copy_pci_info

add return statement to if branch

Dereferencing NULL pointer reported by Coverity, CID 119256. Dereferencing NULL pointer reported by Coverity, CID 119257.

---
 lib/librte_ether/rte_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
lib/librte_ether/rte_ethdev.c +1 -0
index e0e1dca..1b73f29 100644
@@ -3276,6 +3276,7 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_de
 	if ((eth_dev == NULL) || (pci_dev == NULL)) {
 		PMD_DEBUG_TRACE("NULL pointer eth_dev=%p pci_dev=%p\n",
 				eth_dev, pci_dev);
+		return;
 	}
 
 	eth_dev->data->dev_flags = 0;
Signature · 1 line
1.9.1
#2 lore raw

Re: [v2 1/1] librte_ether: fix coverity errors in rte_eth_copy_pci_info

2015-11-06 17:20, Bernard Iremonger:

Quoted 6 lines

add return statement to if branch

Dereferencing NULL pointer reported by Coverity, CID 119256. Dereferencing NULL pointer reported by Coverity, CID 119257.

Fixes 494adb7f63f2 ("ethdev: add device fields from PCI layer")

Applied, thanks