summaryrefslogtreecommitdiff
path: root/target/linux/brcm47xx
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-03-29 15:44:06 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2012-03-29 15:44:06 +0000
commitde0527a354426c4da678866cc3c1ab5d3f940a0c (patch)
tree0b0c88af45c96825829035a739ab003a1fd78a87 /target/linux/brcm47xx
parent9992ce3a51bd8a35fb62fa699dc1c85865bafb66 (diff)
downloadmtk-20170518-de0527a354426c4da678866cc3c1ab5d3f940a0c.zip
mtk-20170518-de0527a354426c4da678866cc3c1ab5d3f940a0c.tar.gz
mtk-20170518-de0527a354426c4da678866cc3c1ab5d3f940a0c.tar.bz2
brcm47xx: fix memory leak, backport from the mainline kernel
SVN-Revision: 31143
Diffstat (limited to 'target/linux/brcm47xx')
-rw-r--r--target/linux/brcm47xx/patches-3.2/235-bcma-fix-memleak.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.2/235-bcma-fix-memleak.patch b/target/linux/brcm47xx/patches-3.2/235-bcma-fix-memleak.patch
new file mode 100644
index 0000000..14d795e
--- /dev/null
+++ b/target/linux/brcm47xx/patches-3.2/235-bcma-fix-memleak.patch
@@ -0,0 +1,29 @@
+--- a/drivers/bcma/scan.c
++++ b/drivers/bcma/scan.c
+@@ -458,15 +458,18 @@ int bcma_bus_scan(struct bcma_bus *bus)
+ core->bus = bus;
+
+ err = bcma_get_next_core(bus, &eromptr, NULL, core_num, core);
+- if (err == -ENODEV) {
+- core_num++;
+- continue;
+- } else if (err == -ENXIO)
+- continue;
+- else if (err == -ESPIPE)
+- break;
+- else if (err < 0)
++ if (err < 0) {
++ kfree(core);
++ if (err == -ENODEV) {
++ core_num++;
++ continue;
++ } else if (err == -ENXIO) {
++ continue;
++ } else if (err == -ESPIPE) {
++ break;
++ }
+ return err;
++ }
+
+ core->core_index = core_num++;
+ bus->nr_cores++;