diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2019-03-20 14:45:09 +0000 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2019-03-20 14:45:37 +0000 |
commit | f7a9461e29147c47ce2bb81bd157ac1833cf5eb1 (patch) | |
tree | 6f3b4f4850cf9f116acc1dda3f0515259673e13b /lib/librte_kvargs | |
parent | 8e6d9d118f6105a3627b64a7949e1fb0b145879e (diff) |
New upstream version 16.11.9upstream/16.11.9upstream-16.11-stable
Change-Id: Ia1ac246c53e5050b6a29d6952fb668ad6c782996
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'lib/librte_kvargs')
-rw-r--r-- | lib/librte_kvargs/rte_kvargs.c | 3 | ||||
-rw-r--r-- | 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 5504c6df..476b8c1d 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 ae9ae79f..83363a8d 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 |