]> git.droids-corp.org - dpdk.git/blobdiff - drivers/net/mlx5/mlx5.c
net/mlx5: fix double free on error handling
[dpdk.git] / drivers / net / mlx5 / mlx5.c
index 3885b0bf0e1a55212d4c6409e559c8b02a8b5e1e..05d4f024a9ce0d8a1dade81286631da20f24fe85 100644 (file)
@@ -690,18 +690,18 @@ 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;
+                       break;
                case EINVAL:
                        DRV_LOG(ERR,
                                "cannot use device, are drivers up to date?");
-                       goto error;
+                       break;
                }
+               goto error;
        }
        ibv_dev = list[i];
        DRV_LOG(DEBUG, "device opened");