projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0833289
)
mtd: nand: don't leak buffers when ->scan_bbt() fails
author
Brian Norris
<
[email protected]
>
Tue, 2 May 2017 00:04:50 +0000
(17:04 -0700)
committer
Boris Brezillon
<
[email protected]
>
Mon, 22 May 2017 07:42:29 +0000
(09:42 +0200)
This bug seems to have been here forever, although we came close to
fixing all of them in [1]!
[1]
11eaf6df1cce
("mtd: nand: Remove BUG() abuse in nand_scan_tail")
Signed-off-by: Brian Norris <
[email protected]
>
Acked-by: Ezequiel Garcia <
[email protected]
>
Signed-off-by: Boris Brezillon <
[email protected]
>
drivers/mtd/nand/nand_base.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/nand/nand_base.c
b/drivers/mtd/nand/nand_base.c
index d474378ed810b3c3ab19d8a4e85e77e0eb15511c..66782291a762499a1fbff5d9001a797fa013d884 100644
(file)
--- a/
drivers/mtd/nand/nand_base.c
+++ b/
drivers/mtd/nand/nand_base.c
@@
-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);