[dpdk-stable] patch 'net/dpaa2: fix possible use of uninitialized vars' has been queued to LTS release 17.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Dec 19 15:34:08 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/21/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. 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 89d047629f76872094fbbdd7bb324c6b82fd50dd Mon Sep 17 00:00:00 2001
From: Andrzej Ostruszka <aostruszka at marvell.com>
Date: Thu, 7 Nov 2019 16:03:14 +0100
Subject: [PATCH] net/dpaa2: fix possible use of uninitialized vars
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 7bbc7dc431a66e81514219f1734ed263a3db3359 ]

This patch fixes 'maybe-uninitialized' warnings reported by compiler
when using LTO.

Compiler warning pointing to this error (with LTO enabled):
error: ‘kg_cfg.extracts[0].masks[0].mask’ may be used uninitialized in
this function [-Werror=maybe-uninitialized]
    extr->masks[j].mask = cfg->extracts[i].masks[j].mask;

Fixes: 16bbc98a3e63 ("bus/fslmc: update MC to 10.3.x")

Signed-off-by: Andrzej Ostruszka <aostruszka at marvell.com>
---
 drivers/net/dpaa2/mc/dpkg.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dpaa2/mc/dpkg.c b/drivers/net/dpaa2/mc/dpkg.c
index 3f98907f49..34d37bfd88 100644
--- a/drivers/net/dpaa2/mc/dpkg.c
+++ b/drivers/net/dpaa2/mc/dpkg.c
@@ -96,7 +96,10 @@ dpkg_prepare_key_cfg(const struct dpkg_profile_cfg *cfg, uint8_t *key_cfg_buf)
 		dpkg_set_field(extr->extract_type, EXTRACT_TYPE,
 			       cfg->extracts[i].type);
 
-		for (j = 0; j < DPKG_NUM_OF_MASKS; j++) {
+		if (extr->num_of_byte_masks > DPKG_NUM_OF_MASKS)
+			return -EINVAL;
+
+		for (j = 0; j < extr->num_of_byte_masks; j++) {
 			extr->masks[j].mask = cfg->extracts[i].masks[j].mask;
 			extr->masks[j].offset =
 				cfg->extracts[i].masks[j].offset;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-19 14:32:30.345947534 +0000
+++ 0101-net-dpaa2-fix-possible-use-of-uninitialized-vars.patch	2019-12-19 14:32:26.233300364 +0000
@@ -1,4 +1,4 @@
-From 7bbc7dc431a66e81514219f1734ed263a3db3359 Mon Sep 17 00:00:00 2001
+From 89d047629f76872094fbbdd7bb324c6b82fd50dd Mon Sep 17 00:00:00 2001
 From: Andrzej Ostruszka <aostruszka at marvell.com>
 Date: Thu, 7 Nov 2019 16:03:14 +0100
 Subject: [PATCH] net/dpaa2: fix possible use of uninitialized vars
@@ -6,6 +6,8 @@
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
+[ upstream commit 7bbc7dc431a66e81514219f1734ed263a3db3359 ]
+
 This patch fixes 'maybe-uninitialized' warnings reported by compiler
 when using LTO.
 
@@ -15,31 +17,17 @@
     extr->masks[j].mask = cfg->extracts[i].masks[j].mask;
 
 Fixes: 16bbc98a3e63 ("bus/fslmc: update MC to 10.3.x")
-Cc: stable at dpdk.org
 
 Signed-off-by: Andrzej Ostruszka <aostruszka at marvell.com>
 ---
- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 +
- drivers/net/dpaa2/mc/dpkg.c            | 5 ++++-
- 2 files changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
-index 16555d7b0b..47a8bda6aa 100644
---- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
-+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
-@@ -51,6 +51,7 @@ rte_pmd_dpaa2_set_custom_hash(uint16_t port_id,
- 	kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_DATA;
- 	kg_cfg.extracts[0].extract.from_data.offset = offset;
- 	kg_cfg.extracts[0].extract.from_data.size = size;
-+	kg_cfg.extracts[0].num_of_byte_masks = 0;
- 	kg_cfg.num_extracts = 1;
- 
- 	ret = dpkg_prepare_key_cfg(&kg_cfg, p_params);
+ drivers/net/dpaa2/mc/dpkg.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
 diff --git a/drivers/net/dpaa2/mc/dpkg.c b/drivers/net/dpaa2/mc/dpkg.c
-index 80f94f40ed..1e171eedc7 100644
+index 3f98907f49..34d37bfd88 100644
 --- a/drivers/net/dpaa2/mc/dpkg.c
 +++ b/drivers/net/dpaa2/mc/dpkg.c
-@@ -63,7 +63,10 @@ dpkg_prepare_key_cfg(const struct dpkg_profile_cfg *cfg, uint8_t *key_cfg_buf)
+@@ -96,7 +96,10 @@ dpkg_prepare_key_cfg(const struct dpkg_profile_cfg *cfg, uint8_t *key_cfg_buf)
  		dpkg_set_field(extr->extract_type, EXTRACT_TYPE,
  			       cfg->extracts[i].type);
  


More information about the stable mailing list