patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue
       [not found] <1522918464-4586-1-git-send-email-hemant.agrawal@nxp.com>
@ 2018-04-09 10:22 ` Hemant Agrawal
  2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 2/8] bus/dpaa: fix the unchecked return value Hemant Agrawal
                     ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Sunil Kumar Kori, stable

From: Sunil Kumar Kori <sunil.kori@nxp.com>

Fixes: 9d32ef0f5d61 ("bus/dpaa: support creating dynamic HW portal")
Coverity issue: 268332
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/base/qbman/qman_driver.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c
index 66838d2..07b29d5 100644
--- a/drivers/bus/dpaa/base/qbman/qman_driver.c
+++ b/drivers/bus/dpaa/base/qbman/qman_driver.c
@@ -160,6 +160,7 @@ struct qman_portal *fsl_qman_portal_create(void)
 				     &cpuset);
 	if (ret) {
 		error(0, ret, "pthread_getaffinity_np()");
+		kfree(q_pcfg);
 		return NULL;
 	}
 
@@ -168,12 +169,14 @@ struct qman_portal *fsl_qman_portal_create(void)
 		if (CPU_ISSET(loop, &cpuset)) {
 			if (q_pcfg->cpu != -1) {
 				pr_err("Thread is not affine to 1 cpu\n");
+				kfree(q_pcfg);
 				return NULL;
 			}
 			q_pcfg->cpu = loop;
 		}
 	if (q_pcfg->cpu == -1) {
 		pr_err("Bug in getaffinity handling!\n");
+		kfree(q_pcfg);
 		return NULL;
 	}
 
@@ -183,6 +186,7 @@ struct qman_portal *fsl_qman_portal_create(void)
 	ret = process_portal_map(&q_map);
 	if (ret) {
 		error(0, ret, "process_portal_map()");
+		kfree(q_pcfg);
 		return NULL;
 	}
 	q_pcfg->channel = q_map.channel;
@@ -217,6 +221,7 @@ struct qman_portal *fsl_qman_portal_create(void)
 	close(q_fd);
 err1:
 	process_portal_unmap(&q_map.addr);
+	kfree(q_pcfg);
 	return NULL;
 }
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-stable] [PATCH v2 2/8] bus/dpaa: fix the unchecked return value
  2018-04-09 10:22 ` [dpdk-stable] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
@ 2018-04-09 10:22   ` Hemant Agrawal
  2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 3/8] net/dpaa: fix the array overrun Hemant Agrawal
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Sunil Kumar Kori, stable

From: Sunil Kumar Kori <sunil.kori@nxp.com>

Fixes: 5d944582d028 ("bus/dpaa: check portal presence in the caller function")
Coverity issue: 268323
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 3535da5..ffc90a7 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -308,9 +308,15 @@ rte_dpaa_portal_fq_init(void *arg, struct qman_fq *fq)
 	/* Affine above created portal with channel*/
 	u32 sdqcr;
 	struct qman_portal *qp;
+	int ret;
 
-	if (unlikely(!RTE_PER_LCORE(dpaa_io)))
-		rte_dpaa_portal_init(arg);
+	if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+		ret = rte_dpaa_portal_init(arg);
+		if (ret < 0) {
+			DPAA_BUS_LOG(ERR, "portal initialization failure");
+			return ret;
+		}
+	}
 
 	/* Initialise qman specific portals */
 	qp = fsl_qman_portal_create();
-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-stable] [PATCH v2 3/8] net/dpaa: fix the array overrun
  2018-04-09 10:22 ` [dpdk-stable] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
  2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 2/8] bus/dpaa: fix the unchecked return value Hemant Agrawal
@ 2018-04-09 10:22   ` Hemant Agrawal
  2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 4/8] net/dpaa: fix the oob access Hemant Agrawal
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable

Fixes: 62f53995caaf ("net/dpaa: add frame count based tail drop with CGR")
Coverity issue: 268342
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-By: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index db49364..0aad111 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1105,10 +1105,10 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 			dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE;
 	}
 
-	/* Each device can not have more than DPAA_PCD_FQID_MULTIPLIER RX
+	/* Each device can not have more than DPAA_MAX_NUM_PCD_QUEUES RX
 	 * queues.
 	 */
-	if (num_rx_fqs <= 0 || num_rx_fqs > DPAA_PCD_FQID_MULTIPLIER) {
+	if (num_rx_fqs <= 0 || num_rx_fqs > DPAA_MAX_NUM_PCD_QUEUES) {
 		DPAA_PMD_ERR("Invalid number of RX queues\n");
 		return -EINVAL;
 	}
-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-stable] [PATCH v2 4/8] net/dpaa: fix the oob access
  2018-04-09 10:22 ` [dpdk-stable] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
  2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 2/8] bus/dpaa: fix the unchecked return value Hemant Agrawal
  2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 3/8] net/dpaa: fix the array overrun Hemant Agrawal
@ 2018-04-09 10:22   ` Hemant Agrawal
  2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 5/8] bus/dpaa: fix resource leak Hemant Agrawal
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable

Fixes: b21ed3e2a16d ("net/dpaa: support extended statistics")
Coverity issue: 268318
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-By: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 0aad111..581e3a0 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -335,10 +335,13 @@ dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 static int
 dpaa_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 		      struct rte_eth_xstat_name *xstats_names,
-		      __rte_unused unsigned int limit)
+		      unsigned int limit)
 {
 	unsigned int i, stat_cnt = RTE_DIM(dpaa_xstats_strings);
 
+	if (limit < stat_cnt)
+		return stat_cnt;
+
 	if (xstats_names != NULL)
 		for (i = 0; i < stat_cnt; i++)
 			snprintf(xstats_names[i].name,
@@ -366,7 +369,7 @@ dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 			return 0;
 
 		fman_if_stats_get_all(dpaa_intf->fif, values_copy,
-				      sizeof(struct dpaa_if_stats));
+				      sizeof(struct dpaa_if_stats) / 8);
 
 		for (i = 0; i < stat_cnt; i++)
 			values[i] =
-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-stable] [PATCH v2 5/8] bus/dpaa: fix resource leak
  2018-04-09 10:22 ` [dpdk-stable] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
                     ` (2 preceding siblings ...)
  2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 4/8] net/dpaa: fix the oob access Hemant Agrawal
@ 2018-04-09 10:22   ` Hemant Agrawal
  2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 7/8] net/dpaa2: fix the implementation of xstats Hemant Agrawal
  2018-04-11 22:20   ` [dpdk-stable] [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Thomas Monjalon
  5 siblings, 0 replies; 7+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable

Fixes: 1459585888b5 ("bus/dpaa: fix memory allocation during scan")
Coverity issue: 268337
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-By: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/bus/dpaa/base/fman/fman.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c
index e6fd5f3..be91da4 100644
--- a/drivers/bus/dpaa/base/fman/fman.c
+++ b/drivers/bus/dpaa/base/fman/fman.c
@@ -442,6 +442,7 @@ fman_if_init(const struct device_node *dpa_node)
 		if (!pool_node) {
 			FMAN_ERR(-ENXIO, "%s: bad fsl,bman-buffer-pools\n",
 				 dname);
+			free(bpool);
 			goto err;
 		}
 		pname = pool_node->full_name;
@@ -449,6 +450,7 @@ fman_if_init(const struct device_node *dpa_node)
 		prop = of_get_property(pool_node, "fsl,bpid", &proplen);
 		if (!prop) {
 			FMAN_ERR(-EINVAL, "%s: no fsl,bpid\n", pname);
+			free(bpool);
 			goto err;
 		}
 		assert(proplen == sizeof(*prop));
-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-stable] [PATCH v2 7/8] net/dpaa2: fix the implementation of xstats
  2018-04-09 10:22 ` [dpdk-stable] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
                     ` (3 preceding siblings ...)
  2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 5/8] bus/dpaa: fix resource leak Hemant Agrawal
@ 2018-04-09 10:22   ` Hemant Agrawal
  2018-04-11 22:20   ` [dpdk-stable] [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Thomas Monjalon
  5 siblings, 0 replies; 7+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable

Fixes: 1d6329b2fc1f ("net/dpaa2: support extra stats")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 281483d..eed6dc9 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -1115,12 +1115,12 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 	union dpni_statistics value[3] = {};
 	unsigned int i = 0, num = RTE_DIM(dpaa2_xstats_strings);
 
-	if (xstats == NULL)
-		return 0;
-
 	if (n < num)
 		return num;
 
+	if (xstats == NULL)
+		return 0;
+
 	/* Get Counters from page_0*/
 	retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token,
 				      0, 0, &value[0]);
@@ -1153,10 +1153,13 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 static int
 dpaa2_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 		       struct rte_eth_xstat_name *xstats_names,
-		       __rte_unused unsigned int limit)
+		       unsigned int limit)
 {
 	unsigned int i, stat_cnt = RTE_DIM(dpaa2_xstats_strings);
 
+	if (limit < stat_cnt)
+		return stat_cnt;
+
 	if (xstats_names != NULL)
 		for (i = 0; i < stat_cnt; i++)
 			snprintf(xstats_names[i].name,
-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue
  2018-04-09 10:22 ` [dpdk-stable] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
                     ` (4 preceding siblings ...)
  2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 7/8] net/dpaa2: fix the implementation of xstats Hemant Agrawal
@ 2018-04-11 22:20   ` Thomas Monjalon
  5 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2018-04-11 22:20 UTC (permalink / raw)
  To: Hemant Agrawal, Sunil Kumar Kori; +Cc: dev, ferruh.yigit, stable

09/04/2018 12:22, Hemant Agrawal:
> From: Sunil Kumar Kori <sunil.kori@nxp.com>
> 
> Fixes: 9d32ef0f5d61 ("bus/dpaa: support creating dynamic HW portal")
> Coverity issue: 268332
> Cc: stable@dpdk.org
> 
> Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Series applied, thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-04-11 22:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1522918464-4586-1-git-send-email-hemant.agrawal@nxp.com>
2018-04-09 10:22 ` [dpdk-stable] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 2/8] bus/dpaa: fix the unchecked return value Hemant Agrawal
2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 3/8] net/dpaa: fix the array overrun Hemant Agrawal
2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 4/8] net/dpaa: fix the oob access Hemant Agrawal
2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 5/8] bus/dpaa: fix resource leak Hemant Agrawal
2018-04-09 10:22   ` [dpdk-stable] [PATCH v2 7/8] net/dpaa2: fix the implementation of xstats Hemant Agrawal
2018-04-11 22:20   ` [dpdk-stable] [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).