[dpdk-dev,1/2] net/mlx5: fix multiple free issue when attr ctx is NULL

Message ID DB5PR05MB12541FCE50C1CF9D71AC01CDC29B0@DB5PR05MB1254.eurprd05.prod.outlook.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail apply issues

Commit Message

Raslan Darawsheh May 7, 2018, 5:22 p.m. UTC
  Hi Yongseok,

Thx for your review.
But I already sent a V2 for this patch which handles the redundant goto that I had.
But still missing the fix for title.
I'll submit a v3 tomorrow with a fixed title.


Kindest regards
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 5190b9fcd..270f59b27 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -690,18 +690,16 @@  mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
                break;
        }
        if (attr_ctx == NULL) {
-               mlx5_glue->free_device_list(list);
                switch (err) {
                case 0:
                        DRV_LOG(ERR,
                                "cannot access device, is mlx5_ib loaded?");
                        err = ENODEV;
-                       goto error;
                case EINVAL:
                        DRV_LOG(ERR,
                                "cannot use device, are drivers up to date?");
-                       goto error;
                }
+               goto error;
        }
        ibv_dev = list[i];
        DRV_LOG(DEBUG, "device opened");