Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44d4182e authored by Brian Norris's avatar Brian Norris Committed by Boris Brezillon
Browse files

mtd: nand: don't leak buffers when ->scan_bbt() fails



This bug seems to have been here forever, although we came close to
fixing all of them in [1]!

[1] 11eaf6df ("mtd: nand: Remove BUG() abuse in nand_scan_tail")

Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Acked-by: default avatarEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent 08332893
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -4842,7 +4842,11 @@ int nand_scan_tail(struct mtd_info *mtd)
		return 0;

	/* Build bad block table */
	return chip->scan_bbt(mtd);
	ret = chip->scan_bbt(mtd);
	if (ret)
		goto err_free;
	return 0;

err_free:
	if (nbuf) {
		kfree(nbuf->databuf);