diff options
author | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-03-29 15:44:06 +0000 |
---|---|---|
committer | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-03-29 15:44:06 +0000 |
commit | 62249258d3a4fcb286ca4b1cee723563d09fc228 (patch) | |
tree | 290f578f233aa0a64a7f8e1bc4ba4ebc1f16c0e3 | |
parent | 180c221031e78e8e7731b298eecd6629dfb77fa4 (diff) |
brcm47xx: fix memory leak, backport from the mainline kernel
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31143 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | target/linux/brcm47xx/patches-3.2/235-bcma-fix-memleak.patch | 29 |
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 000000000..14d795e70 --- /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++; |