浏览代码

mtdparts: fix usecount bug

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>
Heiko Schocher 11 年之前
父节点
当前提交
1668d64439
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      common/cmd_mtdparts.c

+ 1 - 0
common/cmd_mtdparts.c

@@ -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;
 }