[dpdk-stable] patch 'kvargs: fix processing a null list' has been queued to LTS release 17.11.5

Yongseok Koh yskoh at mellanox.com
Fri Nov 30 00:11:02 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 76b2239098a772dc81624ae36ad4ae9622590f21 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas at monjalon.net>
Date: Tue, 23 Oct 2018 18:01:40 +0200
Subject: [PATCH] kvargs: fix processing a null list

[ upstream commit 25495407cbda028f7f6d5cce38f78e609cf970e1 ]

In the doxygen description of rte_kvargs_process(), it is said:
	If *kvlist* is NULL function does nothing.
It has been added by mistake here instead of rte_kvargs_free().
Anyway, null list should be correctly handled in both functions.

Comments are fixed in both functions and NULL handling is added
to rte_kvargs_process().

Fixes: c34af7424e09 ("kvargs: fix freeing behaviour for null")

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
Acked-by: Olivier Matz <olivier.matz at 6wind.com>
---
 lib/librte_kvargs/rte_kvargs.c | 3 +++
 lib/librte_kvargs/rte_kvargs.h | 7 +++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/librte_kvargs/rte_kvargs.c b/lib/librte_kvargs/rte_kvargs.c
index 854ac83f5..c71ad4abe 100644
--- a/lib/librte_kvargs/rte_kvargs.c
+++ b/lib/librte_kvargs/rte_kvargs.c
@@ -160,6 +160,9 @@ rte_kvargs_process(const struct rte_kvargs *kvlist,
 	const struct rte_kvargs_pair *pair;
 	unsigned i;
 
+	if (kvlist == NULL)
+		return 0;
+
 	for (i = 0; i < kvlist->count; i++) {
 		pair = &kvlist->pairs[i];
 		if (key_match == NULL || strcmp(pair->key, key_match) == 0) {
diff --git a/lib/librte_kvargs/rte_kvargs.h b/lib/librte_kvargs/rte_kvargs.h
index 5821c726a..53beed504 100644
--- a/lib/librte_kvargs/rte_kvargs.h
+++ b/lib/librte_kvargs/rte_kvargs.h
@@ -107,7 +107,7 @@ struct rte_kvargs *rte_kvargs_parse(const char *args,
  * rte_kvargs_parse().
  *
  * @param kvlist
- *   The rte_kvargs structure
+ *   The rte_kvargs structure. No error if NULL.
  */
 void rte_kvargs_free(struct rte_kvargs *kvlist);
 
@@ -116,11 +116,10 @@ void rte_kvargs_free(struct rte_kvargs *kvlist);
  *
  * For each key/value association that matches the given key, calls the
  * handler function with the for a given arg_name passing the value on the
- * dictionary for that key and a given extra argument. If *kvlist* is NULL
- * function does nothing.
+ * dictionary for that key and a given extra argument.
  *
  * @param kvlist
- *   The rte_kvargs structure
+ *   The rte_kvargs structure. No error if NULL.
  * @param key_match
  *   The key on which the handler should be called, or NULL to process handler
  *   on all associations
-- 
2.11.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-29 15:01:48.224429772 -0800
+++ 0068-kvargs-fix-processing-a-null-list.patch	2018-11-29 15:01:45.174966000 -0800
@@ -1,8 +1,10 @@
-From 25495407cbda028f7f6d5cce38f78e609cf970e1 Mon Sep 17 00:00:00 2001
+From 76b2239098a772dc81624ae36ad4ae9622590f21 Mon Sep 17 00:00:00 2001
 From: Thomas Monjalon <thomas at monjalon.net>
 Date: Tue, 23 Oct 2018 18:01:40 +0200
 Subject: [PATCH] kvargs: fix processing a null list
 
+[ upstream commit 25495407cbda028f7f6d5cce38f78e609cf970e1 ]
+
 In the doxygen description of rte_kvargs_process(), it is said:
 	If *kvlist* is NULL function does nothing.
 It has been added by mistake here instead of rte_kvargs_free().
@@ -12,7 +14,6 @@
 to rte_kvargs_process().
 
 Fixes: c34af7424e09 ("kvargs: fix freeing behaviour for null")
-Cc: stable at dpdk.org
 
 Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
 Acked-by: Olivier Matz <olivier.matz at 6wind.com>
@@ -22,10 +23,10 @@
  2 files changed, 6 insertions(+), 4 deletions(-)
 
 diff --git a/lib/librte_kvargs/rte_kvargs.c b/lib/librte_kvargs/rte_kvargs.c
-index a28f76945..7ec1ea57f 100644
+index 854ac83f5..c71ad4abe 100644
 --- a/lib/librte_kvargs/rte_kvargs.c
 +++ b/lib/librte_kvargs/rte_kvargs.c
-@@ -120,6 +120,9 @@ rte_kvargs_process(const struct rte_kvargs *kvlist,
+@@ -160,6 +160,9 @@ rte_kvargs_process(const struct rte_kvargs *kvlist,
  	const struct rte_kvargs_pair *pair;
  	unsigned i;
  
@@ -36,10 +37,10 @@
  		pair = &kvlist->pairs[i];
  		if (key_match == NULL || strcmp(pair->key, key_match) == 0) {
 diff --git a/lib/librte_kvargs/rte_kvargs.h b/lib/librte_kvargs/rte_kvargs.h
-index fc041956e..1946195de 100644
+index 5821c726a..53beed504 100644
 --- a/lib/librte_kvargs/rte_kvargs.h
 +++ b/lib/librte_kvargs/rte_kvargs.h
-@@ -110,7 +110,7 @@ struct rte_kvargs *rte_kvargs_parse_delim(const char *args,
+@@ -107,7 +107,7 @@ struct rte_kvargs *rte_kvargs_parse(const char *args,
   * rte_kvargs_parse().
   *
   * @param kvlist
@@ -48,7 +49,7 @@
   */
  void rte_kvargs_free(struct rte_kvargs *kvlist);
  
-@@ -119,11 +119,10 @@ void rte_kvargs_free(struct rte_kvargs *kvlist);
+@@ -116,11 +116,10 @@ void rte_kvargs_free(struct rte_kvargs *kvlist);
   *
   * For each key/value association that matches the given key, calls the
   * handler function with the for a given arg_name passing the value on the


More information about the stable mailing list