projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
641c792
)
mtd: docg3: Don't leak docg3->bbt in error path
author
Richard Weinberger
<richard@nod.at>
Mon, 1 Jun 2015 21:10:52 +0000
(23:10 +0200)
committer
Brian Norris
<computersforpeace@gmail.com>
Wed, 17 Jun 2015 01:58:47 +0000
(18:58 -0700)
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/devices/docg3.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/devices/docg3.c
b/drivers/mtd/devices/docg3.c
index be5fb2bd893cc32d8e989037153993c0dde152c5..486936bf41d54069f604de9551fed44e7ca978fa 100644
(file)
--- a/
drivers/mtd/devices/docg3.c
+++ b/
drivers/mtd/devices/docg3.c
@@
-1900,7
+1900,7
@@
doc_probe_device(struct docg3_cascade *cascade, int floor, struct device *dev)
ret = 0;
if (chip_id != (u16)(~chip_id_inv)) {
- goto nomem
3
;
+ goto nomem
4
;
}
switch (chip_id) {
@@
-1910,7
+1910,7
@@
doc_probe_device(struct docg3_cascade *cascade, int floor, struct device *dev)
break;
default:
doc_err("Chip id %04x is not a DiskOnChip G3 chip\n", chip_id);
- goto nomem
3
;
+ goto nomem
4
;
}
doc_set_driver_info(chip_id, mtd);
@@
-1919,6
+1919,8
@@
doc_probe_device(struct docg3_cascade *cascade, int floor, struct device *dev)
doc_reload_bbt(docg3);
return mtd;
+nomem4:
+ kfree(docg3->bbt);
nomem3:
kfree(mtd);
nomem2: