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 2157CA0588; Tue, 7 Apr 2020 13:39:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA2182B96; Tue, 7 Apr 2020 13:39:25 +0200 (CEST) Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id 726232B83; Tue, 7 Apr 2020 13:39:23 +0200 (CEST) Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 3E05D7936381FDEB8D33; Tue, 7 Apr 2020 19:39:22 +0800 (CST) Received: from localhost (10.173.251.152) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Tue, 7 Apr 2020 19:39:13 +0800 From: wangyunjian To: CC: , , , , Yunjian Wang , Date: Tue, 7 Apr 2020 19:39:11 +0800 Message-ID: <1586259551-19324-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-dev] [PATCH v1] net/pfe: fix to set mac_addrs to NULL after freeing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Yunjian Wang It does not correctly set the mac_addrs variable to NULL after freeing it, which will lead to a double free. Fixes: 67fc3ff97c39 ("net/pfe: introduce basic functions") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang --- drivers/net/pfe/pfe_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c index 940347819..ba0f8dd3f 100644 --- a/drivers/net/pfe/pfe_ethdev.c +++ b/drivers/net/pfe/pfe_ethdev.c @@ -397,6 +397,7 @@ pfe_eth_exit(struct rte_eth_dev *dev, struct pfe *pfe) pfe_eth_close_cdev(dev->data->dev_private); rte_free(dev->data->mac_addrs); + dev->data->mac_addrs = NULL; rte_eth_dev_release_port(dev); pfe->nb_devs--; } -- 2.19.1