From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id E60192B91 for ; Mon, 29 Oct 2018 13:53:50 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id y15-v6so8552764wru.9 for ; Mon, 29 Oct 2018 05:53:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ccLRe0P69VVsy3s2FguJDWldpd/RGPsCtF22hV2mZmY=; b=o2Eyhry9Scyihsk0fTNvuTu49UtJm5d+rWOWqed4Nmak1sedlrhf6nPSOvFB8KUAGW 3Ekwjb81lDYu2/MMpBtqRRb1syO2wEnWbjTEKV0BUIWbecUd168hmznNfeY+ING7Hy/6 auQ8d5A5tHmpSZRiBErAgLRdlYyemzxxm8KSMyJ1bSsMliLV2eYWWldMqBkOuR8/mpmS Q8ssV2u0XUgDl13pb04UXLbsR8olNycC07IDimONhWNNYRkA9gPvEyL0xVwBe13gTDvR BYLKaKdZyP0rFDEhw8Y6ZmRTJpDETqFwmK3QbHHec1NVeVJBmntaf7lWLjTMbKjjIKqq Echg== X-Gm-Message-State: AGRZ1gIAk3YIjx56ksgma59tmnHrAzwy0wZvpiB1SOoZkgrPpOE7oIqh vrws4xeaTqbaHimZBOv86/O6PPFG X-Google-Smtp-Source: AJdET5cNRQoM3iKPkGEGmZW98IMl0a2fjwf5QARGUXPC55ERur3iRztPRPw1BNbVdni5g1mLD8dnBA== X-Received: by 2002:adf:e5ca:: with SMTP id a10-v6mr9833206wrn.253.1540817630504; Mon, 29 Oct 2018 05:53:50 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id 138-v6sm6127339wmr.16.2018.10.29.05.53.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 05:53:49 -0700 (PDT) From: Luca Boccassi To: Thomas Monjalon Cc: Olivier Matz , dpdk stable Date: Mon, 29 Oct 2018 12:53:13 +0000 Message-Id: <20181029125329.17729-4-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181029125329.17729-1-bluca@debian.org> References: <20181015115144.27626-1-bluca@debian.org> <20181029125329.17729-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'kvargs: fix processing a null list' has been queued to LTS release 16.11.9 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: Mon, 29 Oct 2018 12:53:51 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/31/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. Luca Boccassi --- >>From c547a6a0841ab3d1d2c547b719a539916b4b766a 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 5504c6df3..476b8c1d1 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 ae9ae79f2..83363a8db 100644 --- a/lib/librte_kvargs/rte_kvargs.h +++ b/lib/librte_kvargs/rte_kvargs.h @@ -106,7 +106,7 @@ struct rte_kvargs *rte_kvargs_parse(const char *args, const char *valid_keys[]); * 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); @@ -115,11 +115,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.19.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-10-29 12:48:14.550518315 +0000 +++ 0004-kvargs-fix-processing-a-null-list.patch 2018-10-29 12:48:14.434417982 +0000 @@ -1,8 +1,10 @@ -From 25495407cbda028f7f6d5cce38f78e609cf970e1 Mon Sep 17 00:00:00 2001 +From c547a6a0841ab3d1d2c547b719a539916b4b766a 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 @@ -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 5504c6df3..476b8c1d1 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 ae9ae79f2..83363a8db 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, +@@ -106,7 +106,7 @@ struct rte_kvargs *rte_kvargs_parse(const char *args, const char *valid_keys[]); * 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); +@@ -115,11 +115,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