examples/ip_pipeline: fix uninitialized KNI parameter
authorReshma Pattan <reshma.pattan@intel.com>
Wed, 18 Apr 2018 16:58:07 +0000 (17:58 +0100)
committerCristian Dumitrescu <cristian.dumitrescu@intel.com>
Tue, 8 May 2018 11:14:05 +0000 (13:14 +0200)
Using uninitialized value p.thread_id when calling kni_create.
Initialize the kni_params object to 0.

Coverity issue: 272569
Fixes: 9a408cc8ac ("examples/ip_pipeline: add KNI object")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
examples/ip_pipeline/cli.c

index 6aebae4..2f30a6d 100644 (file)
@@ -653,6 +653,7 @@ cmd_kni(char **tokens,
        char *name;
        struct kni *kni;
 
+       memset(&p, 0, sizeof(p));
        if ((n_tokens != 6) && (n_tokens != 8)) {
                snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
                return;