[dpdk-dev] example/ip_pipeline: fix value overwrite

Message ID 1449833351-10011-6-git-send-email-roy.fan.zhang@intel.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Fan Zhang Dec. 11, 2015, 11:29 a.m. UTC
  Coverity issue: 107136
Fixes: 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/ip_pipeline/config_parse.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

John McNamara Dec. 11, 2015, 3:44 p.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Fan Zhang
> Sent: Friday, December 11, 2015 11:29 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] example/ip_pipeline: fix value overwrite
> 
> Coverity issue: 107136
> Fixes: 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>
  

Patch

diff --git a/examples/ip_pipeline/config_parse.c b/examples/ip_pipeline/config_parse.c
index 67e58c9..4e194d6 100644
--- a/examples/ip_pipeline/config_parse.c
+++ b/examples/ip_pipeline/config_parse.c
@@ -1631,8 +1631,8 @@  parse_tm(struct app_params *app,
 			param->file_name = strdup(ent->value);
 			if (param->file_name == NULL)
 				ret = -EINVAL;
-
-			ret = 0;
+			else
+				ret = 0;
 		} else if (strcmp(ent->name, "burst_read") == 0)
 			ret = parser_read_uint32(&param->burst_read,
 				ent->value);