]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mtdparts: fix usecount bug
authorHeiko Schocher <hs@denx.de>
Mon, 14 Jul 2014 07:17:11 +0000 (09:17 +0200)
committerAnatolij Gustschin <agust@denx.de>
Thu, 14 Aug 2014 13:00:57 +0000 (15:00 +0200)
add missing put_mtd_device, so mtd->usecount gets correct
decremented in get_mtd_info().

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Tom Rini <trini@ti.com>
common/cmd_mtdparts.c

index 40b6333ebf4cd15959811273da8617f30b15c360..3cb0571df39a4dc0797f93df887dea76768f6484 100644 (file)
@@ -292,6 +292,7 @@ static int get_mtd_info(u8 type, u8 num, struct mtd_info **mtd)
                printf("Device %s not found!\n", mtd_dev);
                return 1;
        }
+       put_mtd_device(*mtd);
 
        return 0;
 }