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

Yongseok Koh yskoh at mellanox.com
Fri Nov 30 00:11:57 CET 2018


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 12/01/18. 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 1fd94133e5aa10aade539d72046e6911c2b8d190 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas at monjalon.net>
Date: Fri, 16 Nov 2018 17:58:51 +0100
Subject: [PATCH] kni: fix possible uninitialized variable

[ upstream commit a17842c1421c1b26f9deed4f6684abdba06e7a56 ]

This error can be raised:
	lib/librte_kni/rte_kni.c:531:15: error:
	'req' may be used uninitialized in this function

It should not happen because kni_fifo_get() would return 0 if
req is not initialized, so the function would return before using req.
But GCC complains about it in -O1 optimization,
and a NULL initialization is harmless here.

Fixes: 3fc5ca2f6352 ("kni: initial import")

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
 lib/librte_kni/rte_kni.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 4b45d1a01..fbd250da6 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -532,7 +532,7 @@ int
 rte_kni_handle_request(struct rte_kni *kni)
 {
 	unsigned ret;
-	struct rte_kni_request *req;
+	struct rte_kni_request *req = NULL;
 
 	if (kni == NULL)
 		return -1;
-- 
2.11.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-29 15:01:50.575441648 -0800
+++ 0123-kni-fix-possible-uninitialized-variable.patch	2018-11-29 15:01:45.321957000 -0800
@@ -1,8 +1,10 @@
-From a17842c1421c1b26f9deed4f6684abdba06e7a56 Mon Sep 17 00:00:00 2001
+From 1fd94133e5aa10aade539d72046e6911c2b8d190 Mon Sep 17 00:00:00 2001
 From: Thomas Monjalon <thomas at monjalon.net>
 Date: Fri, 16 Nov 2018 17:58:51 +0100
 Subject: [PATCH] kni: fix possible uninitialized variable
 
+[ upstream commit a17842c1421c1b26f9deed4f6684abdba06e7a56 ]
+
 This error can be raised:
 	lib/librte_kni/rte_kni.c:531:15: error:
 	'req' may be used uninitialized in this function
@@ -13,7 +15,6 @@
 and a NULL initialization is harmless here.
 
 Fixes: 3fc5ca2f6352 ("kni: initial import")
-Cc: stable at dpdk.org
 
 Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
 ---
@@ -21,10 +22,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
-index c9726d4f8..73aeccccf 100644
+index 4b45d1a01..fbd250da6 100644
 --- a/lib/librte_kni/rte_kni.c
 +++ b/lib/librte_kni/rte_kni.c
-@@ -483,7 +483,7 @@ int
+@@ -532,7 +532,7 @@ int
  rte_kni_handle_request(struct rte_kni *kni)
  {
  	unsigned ret;


More information about the stable mailing list