[dpdk-stable] patch 'net/mlx5: fix double free on error handling' has been queued to LTS release 16.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 15 19:19:28 CEST 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>From 66f7e36563ce484b6c52dd693e5543d01c48972b Mon Sep 17 00:00:00 2001
From: Raslan Darawsheh <rasland at mellanox.com>
Date: Tue, 8 May 2018 12:11:26 +0300
Subject: [PATCH] net/mlx5: fix double free on error handling

[ upstream commit e9f4166014cb7abf8c74b913ff046487d0e7bea2 ]

When attr_ctx is NULL it will attempt to free the list of devices twice.
Avoid double freeing the list by directly going to error handling.

Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")

Signed-off-by: Raslan Darawsheh <rasland at mellanox.com>
Acked-by: Yongseok Koh <yskoh at mellanox.com>
---
 drivers/net/mlx5/mlx5.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 86d1e44c7..506786c4e 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];
 
-- 
2.14.2



More information about the stable mailing list