[dpdk-stable] patch 'net/mlx4: fix drop queue error handling' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:05:45 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/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 ead66a3fb93a254de0dcd91400a8ff2a81210dfb Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba at mellanox.com>
Date: Wed, 6 May 2020 16:27:54 +0000
Subject: [PATCH] net/mlx4: fix drop queue error handling
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 6f155c0b9de5a58b5653d3e81c553564984f3c36 ]

The function mlx4_drop_get() creates pointer to a struct mlx4_drop and
if needed allocates by rte_malloc.

If the allocation is failed the function goes to label “error”, and
there does dereference to a null pointer.

Skip resources cleaning when the memory allocation is failed.

Coverity issue: 146206
Coverity issue: 146146
Fixes: d3a7e09234e4 ("net/mlx4: allocate drop flow resources on demand")

Signed-off-by: Michael Baum <michaelba at mellanox.com>
Acked-by: Matan Azrad <matan at mellanox.com>
---
 drivers/net/mlx4/mlx4_flow.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 96479b83dd..2da4f6d965 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -981,12 +981,13 @@ mlx4_drop_get(struct mlx4_priv *priv)
 	priv->drop = drop;
 	return drop;
 error:
-	if (drop->qp)
-		claim_zero(mlx4_glue->destroy_qp(drop->qp));
-	if (drop->cq)
-		claim_zero(mlx4_glue->destroy_cq(drop->cq));
-	if (drop)
+	if (drop) {
+		if (drop->qp)
+			claim_zero(mlx4_glue->destroy_qp(drop->qp));
+		if (drop->cq)
+			claim_zero(mlx4_glue->destroy_cq(drop->cq));
 		rte_free(drop);
+	}
 	rte_errno = ENOMEM;
 	return NULL;
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:53.171424223 +0100
+++ 0210-net-mlx4-fix-drop-queue-error-handling.patch	2020-05-19 14:04:44.604655406 +0100
@@ -1,4 +1,4 @@
-From 6f155c0b9de5a58b5653d3e81c553564984f3c36 Mon Sep 17 00:00:00 2001
+From ead66a3fb93a254de0dcd91400a8ff2a81210dfb Mon Sep 17 00:00:00 2001
 From: Michael Baum <michaelba at mellanox.com>
 Date: Wed, 6 May 2020 16:27:54 +0000
 Subject: [PATCH] net/mlx4: fix drop queue error handling
@@ -6,6 +6,8 @@
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
+[ upstream commit 6f155c0b9de5a58b5653d3e81c553564984f3c36 ]
+
 The function mlx4_drop_get() creates pointer to a struct mlx4_drop and
 if needed allocates by rte_malloc.
 
@@ -17,7 +19,6 @@
 Coverity issue: 146206
 Coverity issue: 146146
 Fixes: d3a7e09234e4 ("net/mlx4: allocate drop flow resources on demand")
-Cc: stable at dpdk.org
 
 Signed-off-by: Michael Baum <michaelba at mellanox.com>
 Acked-by: Matan Azrad <matan at mellanox.com>
@@ -26,10 +27,10 @@
  1 file changed, 6 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
-index 793f0b090e..2a86382db7 100644
+index 96479b83dd..2da4f6d965 100644
 --- a/drivers/net/mlx4/mlx4_flow.c
 +++ b/drivers/net/mlx4/mlx4_flow.c
-@@ -980,12 +980,13 @@ mlx4_drop_get(struct mlx4_priv *priv)
+@@ -981,12 +981,13 @@ mlx4_drop_get(struct mlx4_priv *priv)
  	priv->drop = drop;
  	return drop;
  error:


More information about the stable mailing list