cmd: mtdparts: fix uninitialized variable warning
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 8 Jun 2017 12:04:03 +0000 (14:04 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 12 Jun 2017 12:38:42 +0000 (08:38 -0400)
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>
cmd/mtdparts.c

index 112bf1f3e3cd51e5a30d8f941b88d20ee0fae031..683c48bdad1bc0a9a1c023d8d3802f138d115da2 100644 (file)
@@ -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) {