[dpdk-dev] [dpdk-stv] [PATCH 1/1] Fix the pointer 'ctx1' uninitialized error with gcc 4.5.1

Min Cao min.cao at intel.com
Mon Jun 16 05:22:11 CEST 2014


Discription: This patch is aimed to fix the the pointer 'ctx1' uninitialized error with gcc4.5.1 as described below:
"dpdk/lib/librte_kvargs/rte_kvargs.c:51:14: error: 'ctx1' may be used uninitialized in this function"

Signed-off-by: Cao Min <min.cao at intel.com>
Acked-by: Liu, Jijiang <jijiang.liu at intel.com>
Tested-by: Waterman Cao <waterman.cao at intel.com>
---
 lib/librte_kvargs/rte_kvargs.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/librte_kvargs/rte_kvargs.c b/lib/librte_kvargs/rte_kvargs.c
index a7586a3..8bc1e46 100644
--- a/lib/librte_kvargs/rte_kvargs.c
+++ b/lib/librte_kvargs/rte_kvargs.c
@@ -48,7 +48,9 @@ static int
 rte_kvargs_tokenize(struct rte_kvargs *kvlist, const char *params)
 {
 	unsigned i;
-	char *str, *ctx1, *ctx2;
+	char *str;
+	char *ctx1 = NULL;
+	char *ctx2 = NULL;
 
 	/* Copy the const char *params to a modifiable string
 	 * to pass to rte_strsplit
-- 
1.7.3.1



More information about the dev mailing list