[dpdk-stable] patch 'net/mlx4: fix possible uninitialized variable' has been queued to LTS release 17.11.5

Yongseok Koh yskoh at mellanox.com
Fri Jan 11 11:31:42 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 01/13/19. 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. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Yongseok

---
>From 2798999e0889d6762b4d79450028a6369ce52f22 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas at monjalon.net>
Date: Fri, 16 Nov 2018 17:58:52 +0100
Subject: [PATCH] net/mlx4: fix possible uninitialized variable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 554f06d10b1c646f20d7011a30b26fb43507d596 ]

When compiling with gcc -O1, this error appears:
	drivers/net/mlx4/mlx4_ethdev.c: In function ‘mlx4_rxmode_toggle’:
	rte_log.h:321:3: error:
	‘mode’ may be used uninitialized in this function

The function mlx4_rxmode_toggle is never called with a value which
is not in the switch block, but GCC complains about it with -O1.
So the default case is "fixed" by setting string "undefined".

Fixes: eacaac7bae36 ("net/mlx4: restore promisc and allmulti support")

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
 drivers/net/mlx4/mlx4_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
index 89f552c87..170e2cb1b 100644
--- a/drivers/net/mlx4/mlx4_ethdev.c
+++ b/drivers/net/mlx4/mlx4_ethdev.c
@@ -386,6 +386,8 @@ mlx4_rxmode_toggle(struct rte_eth_dev *dev, enum rxmode_toggle toggle)
 		mode = "all multicast";
 		dev->data->all_multicast = toggle & 1;
 		break;
+	default:
+		mode = "undefined";
 	}
 	if (!mlx4_flow_sync(priv, &error))
 		return;
-- 
2.11.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-01-11 02:29:11.933698072 -0800
+++ 0019-net-mlx4-fix-possible-uninitialized-variable.patch	2019-01-11 02:29:10.839972000 -0800
@@ -1,4 +1,4 @@
-From 554f06d10b1c646f20d7011a30b26fb43507d596 Mon Sep 17 00:00:00 2001
+From 2798999e0889d6762b4d79450028a6369ce52f22 Mon Sep 17 00:00:00 2001
 From: Thomas Monjalon <thomas at monjalon.net>
 Date: Fri, 16 Nov 2018 17:58:52 +0100
 Subject: [PATCH] net/mlx4: fix possible uninitialized variable
@@ -6,6 +6,8 @@
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
+[ upstream commit 554f06d10b1c646f20d7011a30b26fb43507d596 ]
+
 When compiling with gcc -O1, this error appears:
 	drivers/net/mlx4/mlx4_ethdev.c: In function ‘mlx4_rxmode_toggle’:
 	rte_log.h:321:3: error:
@@ -16,7 +18,6 @@
 So the default case is "fixed" by setting string "undefined".
 
 Fixes: eacaac7bae36 ("net/mlx4: restore promisc and allmulti support")
-Cc: stable at dpdk.org
 
 Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
 ---
@@ -24,10 +25,10 @@
  1 file changed, 2 insertions(+)
 
 diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
-index 30deb3ef0..195a1b6df 100644
+index 89f552c87..170e2cb1b 100644
 --- a/drivers/net/mlx4/mlx4_ethdev.c
 +++ b/drivers/net/mlx4/mlx4_ethdev.c
-@@ -360,6 +360,8 @@ mlx4_rxmode_toggle(struct rte_eth_dev *dev, enum rxmode_toggle toggle)
+@@ -386,6 +386,8 @@ mlx4_rxmode_toggle(struct rte_eth_dev *dev, enum rxmode_toggle toggle)
  		mode = "all multicast";
  		dev->data->all_multicast = toggle & 1;
  		break;


More information about the stable mailing list