Skip to contentSkip to conversation

mtdparts: fix usecount bug

PATCH New Heiko Schocher 1 participant 1 message Jul 14, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 mtdparts: fix usecount bug

add missing put_mtd_device, so mtd->usecount gets correct decremented in get_mtd_info().

---
found this bug with the linux v3.14 mtd/ubi/ubifs sync, but this is also wrong in current mainline.

 common/cmd_mtdparts.c | 1 +
 1 file changed, 1 insertion(+)
common/cmd_mtdparts.c +1 -0
index 40b6333..3cb0571 100644
@@ -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;
 }
Signature · 1 line
1.8.3.1