Skip to contentSkip to conversation

cmd: mtdparts: fix uninitialized variable warning

PATCH In review Lothar Waßmann 2 participants 2 messages Jun 8, 2017 – Jun 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 cmd/mtdparts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/mtdparts.c +1 -1
index 112bf1f..683c48b 100644
@@ -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) {
Signature · 1 line
2.1.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Lothar Waßmann

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.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170612/8ef5bd04/attachment.sig>