Message ID | 20241023115955.1207617-16-vanshika.shukla@nxp.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8A86045BB0; Wed, 23 Oct 2024 14:01:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BAAA542DD5; Wed, 23 Oct 2024 14:00:23 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id AE184402E6 for <dev@dpdk.org>; Wed, 23 Oct 2024 14:00:03 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8E72B20255B; Wed, 23 Oct 2024 14:00:03 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5F89A20254C; Wed, 23 Oct 2024 14:00:03 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id C9E99183DC04; Wed, 23 Oct 2024 20:00:02 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal <hemant.agrawal@nxp.com>, Sachin Saxena <sachin.saxena@nxp.com> Cc: Rohit Raj <rohit.raj@nxp.com> Subject: [v5 15/42] bus/fslmc: free VFIO group FD in case of add group failure Date: Wed, 23 Oct 2024 17:29:28 +0530 Message-Id: <20241023115955.1207617-16-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241023115955.1207617-1-vanshika.shukla@nxp.com> References: <20241022191256.516818-1-vanshika.shukla@nxp.com> <20241023115955.1207617-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
DPAA2 specific patches
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
Commit Message
Vanshika Shukla
Oct. 23, 2024, 11:59 a.m. UTC
From: Rohit Raj <rohit.raj@nxp.com> Free vfio_group_fd if add group fails to avoid resource leak Signed-off-by: Rohit Raj <rohit.raj@nxp.com> --- drivers/bus/fslmc/fslmc_vfio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 63e84cb4d8..3d466d3f1f 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -343,8 +343,10 @@ fslmc_vfio_open_group_fd(const char *group_name) } else { ret = fslmc_vfio_add_group(vfio_group_fd, iommu_group_num, group_name); - if (ret) + if (ret) { + close(vfio_group_fd); return ret; + } } return vfio_group_fd;