diff mbox series

[6/6] net/mlx4: fix dereference after null check

Message ID 20211101175337.83358-6-hkalra@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers show
Series [1/6] interrupts: fix argument cannot be negative | expand

Checks

Context Check Description
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/checkpatch success coding style OK

Commit Message

Harman Kalra Nov. 1, 2021, 5:53 p.m. UTC
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@marvell.com>
---
 drivers/net/mlx4/mlx4.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Slava Ovsiienko Nov. 2, 2021, 7:34 a.m. UTC | #1
> -----Original Message-----
> From: Harman Kalra <hkalra@marvell.com>
> Sent: Monday, November 1, 2021 19:54
> To: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>
> Cc: david.marchand@redhat.com; john.mcnamara@intel.com; Harman Kalra
> <hkalra@marvell.com>
> Subject: [PATCH 6/6] net/mlx4: fix dereference after null check
> 
> 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@marvell.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
David Marchand Nov. 8, 2021, 4:32 p.m. UTC | #2
On Tue, Nov 2, 2021 at 8:34 AM Slava Ovsiienko <viacheslavo@nvidia.com> wrote:
>
> > -----Original Message-----
> > From: Harman Kalra <hkalra@marvell.com>
> > Sent: Monday, November 1, 2021 19:54
> > To: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> > <viacheslavo@nvidia.com>
> > Cc: david.marchand@redhat.com; john.mcnamara@intel.com; Harman Kalra
> > <hkalra@marvell.com>
> > Subject: [PATCH 6/6] net/mlx4: fix dereference after null check
> >
> > 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@marvell.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
>

I would have loved to see more reviews but in any case, lgtm.
For the series:
Acked-by: David Marchand <david.marchand@redhat.com>

Series applied, thanks.
diff mbox series

Patch

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;