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 5E840A04B5; Fri, 11 Sep 2020 12:58:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3CE4A1C0CE; Fri, 11 Sep 2020 12:58:03 +0200 (CEST) Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) by dpdk.org (Postfix) with ESMTP id D4573E07; Fri, 11 Sep 2020 12:58:01 +0200 (CEST) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 274EE5DC083B94F0D9C4; Fri, 11 Sep 2020 18:58:00 +0800 (CST) Received: from localhost (10.174.185.168) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Fri, 11 Sep 2020 18:57:51 +0800 From: wangyunjian To: CC: , , , , , Yunjian Wang , Date: Fri, 11 Sep 2020 18:57:42 +0800 Message-ID: <1599821862-27816-1-git-send-email-wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <20200614140034.E5CDC49E0@dpdk.org> References: <20200614140034.E5CDC49E0@dpdk.org> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.185.168] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2] vfio: fix mem leak when unmapping resource 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 The 'vfio_res' is not freed when unmapping resource by primary process. This leads to memory leak. Fixes: ab53203e194b ("vfio: enable unmapping resource for secondary") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang --- v2: Update email address --- drivers/bus/pci/linux/pci_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index c15ed3bad..91131ce6a 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -1003,7 +1003,7 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev) } TAILQ_REMOVE(vfio_res_list, vfio_res, next); - + rte_free(vfio_res); return 0; } -- 2.23.0