librte_ether: fix coverity errors
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
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.
Signed-off-by Bernard Iremonger <[email protected]>
--- lib/librte_ether/rte_ethdev.c | 1 + 1 file changed, 1 insertion(+)
lib/librte_ether/rte_ethdev.c +1 -0
@@ -3276,6 +3276,7 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_deif ((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
Thomas Monjalon
AppliedRe: [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.
Signed-off-by Bernard Iremonger <[email protected]>
Fixes 494adb7f63f2 ("ethdev: add device fields from PCI layer")
Applied, thanks