[dpdk-stable] patch 'bus/dpaa: fix fd check before close' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:43:22 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/30/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From cf1ded5fa15cd96ab87a7210754ba65dfad7aed2 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Tue, 15 Sep 2020 19:57:40 +0800
Subject: [PATCH] bus/dpaa: fix fd check before close

[ upstream commit c61dc9713666e8c707352ec7d4ec23e4c4d9fdc7 ]

The fd is possibly a negative value while it is passed as an
argument to function "close". Fix the check to the fd.

Fixes: b9c94167904f ("bus/dpaa: decouple FQ portal alloc and init")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 drivers/bus/dpaa/base/qbman/qman_driver.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c
index 464998fe91..e1dee17542 100644
--- a/drivers/bus/dpaa/base/qbman/qman_driver.c
+++ b/drivers/bus/dpaa/base/qbman/qman_driver.c
@@ -132,7 +132,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
 	struct qm_portal_config *q_pcfg;
 	struct dpaa_ioctl_irq_map irq_map;
 	struct dpaa_ioctl_portal_map q_map = {0};
-	int q_fd = 0, ret;
+	int q_fd, ret;
 
 	q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0);
 	if (!q_pcfg) {
@@ -169,7 +169,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
 	if (!portal) {
 		pr_err("Qman portal initialisation failed (%d)\n",
 		       q_pcfg->cpu);
-		goto err;
+		goto err_alloc;
 	}
 
 	irq_map.type = dpaa_portal_qman;
@@ -178,9 +178,9 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
 
 	*fd = q_fd;
 	return portal;
+err_alloc:
+	close(q_fd);
 err:
-	if (q_fd)
-		close(q_fd);
 	process_portal_unmap(&q_map.addr);
 	kfree(q_pcfg);
 	return NULL;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:13.135903536 +0000
+++ 0043-bus-dpaa-fix-fd-check-before-close.patch	2020-10-28 10:35:11.504830024 +0000
@@ -1,13 +1,14 @@
-From c61dc9713666e8c707352ec7d4ec23e4c4d9fdc7 Mon Sep 17 00:00:00 2001
+From cf1ded5fa15cd96ab87a7210754ba65dfad7aed2 Mon Sep 17 00:00:00 2001
 From: Yunjian Wang <wangyunjian at huawei.com>
 Date: Tue, 15 Sep 2020 19:57:40 +0800
 Subject: [PATCH] bus/dpaa: fix fd check before close
 
+[ upstream commit c61dc9713666e8c707352ec7d4ec23e4c4d9fdc7 ]
+
 The fd is possibly a negative value while it is passed as an
 argument to function "close". Fix the check to the fd.
 
 Fixes: b9c94167904f ("bus/dpaa: decouple FQ portal alloc and init")
-Cc: stable at dpdk.org
 
 Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
 Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
@@ -16,10 +17,10 @@
  1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c
-index a466c698fc..6d9aaff164 100644
+index 464998fe91..e1dee17542 100644
 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c
 +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c
-@@ -142,7 +142,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
+@@ -132,7 +132,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
  	struct qm_portal_config *q_pcfg;
  	struct dpaa_ioctl_irq_map irq_map;
  	struct dpaa_ioctl_portal_map q_map = {0};
@@ -28,7 +29,7 @@
  
  	q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0);
  	if (!q_pcfg) {
-@@ -179,7 +179,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
+@@ -169,7 +169,7 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
  	if (!portal) {
  		pr_err("Qman portal initialisation failed (%d)\n",
  		       q_pcfg->cpu);
@@ -37,7 +38,7 @@
  	}
  
  	irq_map.type = dpaa_portal_qman;
-@@ -188,9 +188,9 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
+@@ -178,9 +178,9 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd)
  
  	*fd = q_fd;
  	return portal;


More information about the stable mailing list