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 EE414A04A3; Sun, 14 Jun 2020 16:00:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E5CDC49E0; Sun, 14 Jun 2020 16:00:34 +0200 (CEST) Received: from qq.com (out203-205-221-210.mail.qq.com [203.205.221.210]) by dpdk.org (Postfix) with ESMTP id 20BCFFFA; Sun, 14 Jun 2020 16:00:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1592143225; bh=p9+Tk1NAlRhTc+K6tQ2ZH38R7Bud0jErNt/G7Hia+ew=; h=From:To:Cc:Subject:Date; b=n7l+lZ2JRjM66PxO/LJwQQT2SVzWerzg9vFcidIhNbHdtBOJAwaAiB7ZxHwv8Z0Kg YoNBHXyxlzHdYuMCl2KN4XEGAydsxpXA82un6aGdVInQLdZrjfdT1kOLqXu47c52KC JsgIIyjbjZaBm/+EaSTRzcWTyNqVs2Qc+9pY/0ks= Received: from localhost.localdomain ([117.147.70.3]) by newxmesmtplogicsvrszc8.qq.com (NewEsmtp) with SMTP id A25661; Sun, 14 Jun 2020 22:00:10 +0800 X-QQ-mid: xmsmtpt1592143210tijewogqv Messag-ID: X-QQ-XMAILINFO: ORpa5n6i7OVIH2zbZ7t9EKYXiuqek15leJ2cMHo3C11wWT55Lc6TEHajPWjBaN 9I/akoK2YeGbFTBBe2cFg+4gzWhZdfo7srvse3kR5572wQF5vKjdUZACFtJOm8nY3I6JpRDOHUHN jC9c7gnp+DjnSxjigAnnYUkiSvH1ml4UZkm0JJmguRygXiTseeZsajmHVi0jf9PJzPsALYIKnwb0 2mGPUEYzBJ2V4r8kLDpD8laQ3GgAxTJF6hhh2QGPNnNqHRN48+wAh4S4xNEsQQT+q1sKwERiAOyY ZxA94r/8iCZk6bm3psTOC0I6ojAKWDVBqrR4HcaeyGdoFpcMKZv6G7akTN44Em4wT7ZhhA0iJiWY O5cZuFe8JHOl5z6p8kjJonOjZOTlFn+zRNCWD4ZYRzYU/Abu388PMnIPfnyD28Q3FhRQ+09AksMV zl1Akn06AjMYjgvNmKbme6shl0V+dyizNyoliIQ/Pp0FzGOKsZcmicpW/gmdLR13z0DtolpyaRg6 MIlqq9HRJyfwfKHv8MdSoBIehJYTiYlxlGu9IHqqB9z3hA1R9iY/tIUlN3mwwMUtUzC0Mc19xepi iFKb9FM0gbjSSwNjRAmUfF+Xp8TN47GEc4lfKlPPwlvjP4fMC5PgLv3q4RxO5r9T57rN6zezPahP fYMx9Y7nJ+/kfI9lLG5sCuFjvSlESE5Ni+0M4AMiwjUGJorDd0enhEYRv7H8+5pRzv7wU6auyjOQ lK From: Yunjian Wang To: dev@dpdk.org Cc: anatoly.burakov@intel.com, Yunjian Wang , stable@dpdk.org Date: Sun, 14 Jun 2020 21:59:59 +0800 X-OQ-MSGID: <6748c651950e0390ed78b4285ce3fbe9c03d61bf.1592142438.git.yunjian.wang@foxmail.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] 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" Message-Id: <20200614140034.E5CDC49E0@dpdk.org> 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 --- drivers/bus/pci/linux/pci_vfio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index 64cd84a68..bf4c3c1fa 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -966,6 +966,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.18.1