[dpdk-dev] [PATCH 6/6] net/mlx4: fix dereference after null check
Harman Kalra
hkalra at marvell.com
Mon Nov 1 18:53:37 CET 2021
This patch fixes coverity issue by adding a NULL check
Coverity issue: 373687
Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
Signed-off-by: Harman Kalra <hkalra at marvell.com>
---
drivers/net/mlx4/mlx4.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index cccc71f757..3f3c4a7c72 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -1112,7 +1112,8 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
prev_dev = eth_dev;
continue;
port_error:
- rte_intr_instance_free(priv->intr_handle);
+ if (priv != NULL)
+ rte_intr_instance_free(priv->intr_handle);
rte_free(priv);
if (eth_dev != NULL)
eth_dev->data->dev_private = NULL;
--
2.18.0
More information about the dev
mailing list