From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CFB13A057B for ; Tue, 7 Apr 2020 13:35:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ABD092B96; Tue, 7 Apr 2020 13:35:53 +0200 (CEST) Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by dpdk.org (Postfix) with ESMTP id 2ABD12B96; Tue, 7 Apr 2020 13:35:52 +0200 (CEST) Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 765AD54CA2CA946B82C6; Tue, 7 Apr 2020 19:35:51 +0800 (CST) Received: from localhost (10.173.251.152) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Tue, 7 Apr 2020 19:35:44 +0800 From: wangyunjian To: CC: , , , Yunjian Wang , Date: Tue, 7 Apr 2020 19:35:43 +0800 Message-ID: <1586259343-6272-1-git-send-email-wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.173.251.152] X-CFilter-Loop: Reflected Subject: [dpdk-stable] [dpdk-dev] [PATCH v1] net/octeontx: fix dangling pointer on failure X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Yunjian Wang When octeontx_create() is cleaning up, it does not correctly set the mac_addrs variable to NULL, which will lead to a double free. Fixes: 9e399b88ce2f ("net/octeontx: fix memory leak of MAC address table") CC: stable@dpdk.org Signed-off-by: Yunjian Wang --- drivers/net/octeontx/octeontx_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index e8aa4ec78..437abd7e5 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -1181,6 +1181,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, free_mac_addrs: rte_free(data->mac_addrs); + data->mac_addrs = NULL; err: if (nic) octeontx_port_close(nic); -- 2.19.1