summaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx5/mlx5.c
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2018-07-24 16:52:29 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2018-07-24 16:53:31 +0100
commit43192222b329b3c984687235b0081c7fbfe484ba (patch)
tree8e74c04b227d5386d40bbd987ddf132b43ddb313 /drivers/net/mlx5/mlx5.c
parent18af4227fa5eee002b1a79207935620f6112803e (diff)
New upstream version 16.11.7upstream/16.11.7
Change-Id: I1dbe85956ca329c829b0066d16b3f902c237fbd3 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5.c')
-rw-r--r--drivers/net/mlx5/mlx5.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 86d1e44c..eb266b2c 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -422,17 +422,16 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
break;
}
if (attr_ctx == NULL) {
- ibv_free_device_list(list);
switch (err) {
case 0:
ERROR("cannot access device, is mlx5_ib loaded?");
- return -ENODEV;
+ err = ENODEV;
+ break;
case EINVAL:
ERROR("cannot use device, are drivers up to date?");
- return -EINVAL;
+ break;
}
- assert(err > 0);
- return -err;
+ goto error;
}
ibv_dev = list[i];
@@ -685,6 +684,8 @@ port_error:
claim_zero(ibv_dealloc_pd(pd));
if (ctx)
claim_zero(ibv_close_device(ctx));
+ if (eth_dev && rte_eal_process_type() == RTE_PROC_PRIMARY)
+ rte_eth_dev_release_port(eth_dev);
break;
}