[dpdk-dev,v2] examples/ip_pipeline: fix uninitialized scalar variable

Message ID 20180420143921.73335-1-roy.fan.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Cristian Dumitrescu
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Fan Zhang April 20, 2018, 2:39 p.m. UTC
  Coverity issue: 272575
Fixes: 133c2c6565d6 ("examples/ip_pipeline: add link object")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
v2:
- removed unecessary link.c update

 examples/ip_pipeline/cli.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Jasvinder Singh April 23, 2018, 9:04 a.m. UTC | #1
> -----Original Message-----
> From: Zhang, Roy Fan
> Sent: Friday, April 20, 2018 3:39 PM
> To: dev@dpdk.org
> Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Singh, Jasvinder
> <jasvinder.singh@intel.com>
> Subject: [PATCH v2] examples/ip_pipeline: fix uninitialized scalar variable
> 
> Coverity issue: 272575
> Fixes: 133c2c6565d6 ("examples/ip_pipeline: add link object")
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> ---
> v2:
> - removed unecessary link.c update
> 
>  examples/ip_pipeline/cli.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c index
> 199a31ff8..ec150ce4e 100644
> --- a/examples/ip_pipeline/cli.c
> +++ b/examples/ip_pipeline/cli.c
> @@ -138,6 +138,8 @@ cmd_link(char **tokens,
>  	struct link *link;
>  	char *name;
> 
> +	memset(&p, 0, sizeof(p));
> +
>  	if ((n_tokens < 13) || (n_tokens > 14 + LINK_RXQ_RSS_MAX)) {
>  		snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
>  		return;
> --
> 2.13.6

Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
  

Patch

diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
index 199a31ff8..ec150ce4e 100644
--- a/examples/ip_pipeline/cli.c
+++ b/examples/ip_pipeline/cli.c
@@ -138,6 +138,8 @@  cmd_link(char **tokens,
 	struct link *link;
 	char *name;
 
+	memset(&p, 0, sizeof(p));
+
 	if ((n_tokens < 13) || (n_tokens > 14 + LINK_RXQ_RSS_MAX)) {
 		snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
 		return;