From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id C049C1B494 for ; Thu, 22 Nov 2018 17:51:58 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 258C0308339C; Thu, 22 Nov 2018 16:51:58 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id DDD6060FD9; Thu, 22 Nov 2018 16:51:56 +0000 (UTC) From: Kevin Traynor To: Thomas Monjalon Cc: Olivier Matz , dpdk stable Date: Thu, 22 Nov 2018 16:49:12 +0000 Message-Id: <20181122164957.13003-20-ktraynor@redhat.com> In-Reply-To: <20181122164957.13003-1-ktraynor@redhat.com> References: <20181122164957.13003-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 22 Nov 2018 16:51:58 +0000 (UTC) Subject: [dpdk-stable] patch 'kvargs: fix processing a null list' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:51:59 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/28/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. Kevin Traynor --- >>From 5df3c71261f8f3cacf54fe4df778d967d76233ba Mon Sep 17 00:00:00 2001 From: Thomas Monjalon 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 Acked-by: Olivier Matz --- 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 a28f76945..7ec1ea57f 100644 --- a/lib/librte_kvargs/rte_kvargs.c +++ b/lib/librte_kvargs/rte_kvargs.c @@ -121,4 +121,7 @@ rte_kvargs_process(const struct rte_kvargs *kvlist, unsigned i; + if (kvlist == NULL) + return 0; + for (i = 0; i < kvlist->count; i++) { pair = &kvlist->pairs[i]; diff --git a/lib/librte_kvargs/rte_kvargs.h b/lib/librte_kvargs/rte_kvargs.h index fc041956e..1946195de 100644 --- a/lib/librte_kvargs/rte_kvargs.h +++ b/lib/librte_kvargs/rte_kvargs.h @@ -111,5 +111,5 @@ struct rte_kvargs *rte_kvargs_parse_delim(const char *args, * * @param kvlist - * The rte_kvargs structure + * The rte_kvargs structure. No error if NULL. */ void rte_kvargs_free(struct rte_kvargs *kvlist); @@ -120,9 +120,8 @@ 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 -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-22 16:47:32.795478041 +0000 +++ 0020-kvargs-fix-processing-a-null-list.patch 2018-11-22 16:47:32.000000000 +0000 @@ -1,8 +1,10 @@ -From 25495407cbda028f7f6d5cce38f78e609cf970e1 Mon Sep 17 00:00:00 2001 +From 5df3c71261f8f3cacf54fe4df778d967d76233ba Mon Sep 17 00:00:00 2001 From: Thomas Monjalon 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@dpdk.org Signed-off-by: Thomas Monjalon Acked-by: Olivier Matz