From: Lothar Waßmann <LW@KARO-electronics.de>
Date: Thu, 8 Jun 2017 12:04:03 +0000 (+0200)
Subject: cmd: mtdparts: fix uninitialized variable warning
X-Git-Tag: v2025.01-rc5-pxa1908~6565
X-Git-Url: http://git.dujemihanovic.xyz/img/static/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/html/index.html?a=commitdiff_plain;h=1aca4d5ae9f3c6af018105f89984752cdbdba121;p=u-boot.git

cmd: mtdparts: fix uninitialized variable warning

commit 06a040a31bcf ("cmd: mtdparts: fix null pointer dereference in parse_mtdparts")
removed the initialization of a pointer variable, which is
subsequently used in a debug() call. This produces an uninitialized
variable warning, when compiling with DEBUG defined.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---

diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c
index 112bf1f3e3..683c48bdad 100644
--- a/cmd/mtdparts.c
+++ b/cmd/mtdparts.c
@@ -1556,7 +1556,7 @@ static int parse_mtdparts(const char *const mtdparts)
 	int err = 1;
 	char tmp_parts[MTDPARTS_MAXLEN];
 
-	debug("\n---parse_mtdparts---\nmtdparts = %s\n\n", p);
+	debug("\n---parse_mtdparts---\nmtdparts = %s\n\n", mtdparts);
 
 	/* delete all devices and partitions */
 	if (mtd_devices_init() != 0) {