brcm47xx: fix memory leak, backport from the mainline kernel
SVN-Revision: 31143
This commit is contained in:
parent
9992ce3a51
commit
de0527a354
1 changed files with 29 additions and 0 deletions
29
target/linux/brcm47xx/patches-3.2/235-bcma-fix-memleak.patch
Normal file
29
target/linux/brcm47xx/patches-3.2/235-bcma-fix-memleak.patch
Normal file
|
@ -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++;
|
Loading…
Reference in a new issue