]> git.baikalelectronics.ru Git - kernel.git/commit
bcma: Fix mem leak in bcma_bus_scan()
authorJesper Juhl <jj@chaosbits.net>
Sun, 29 Jan 2012 20:34:04 +0000 (21:34 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 1 Feb 2012 20:24:35 +0000 (15:24 -0500)
commitdba327e12a5c957245b42238f72c5f3b15e072f1
treec77aa11e55066e784182b15f450144c37af62f3b
parent51a0bbf7097e9596771fb2280ac55f77809c69f1
bcma: Fix mem leak in bcma_bus_scan()

bcma_bus_scan() leaks 'struct bcma_device' bytes if
bcma_get_next_core() returns error.

Restructure the code so we always kfree() the memory we allocate to
the variable 'core' before it goes out of scope.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/bcma/scan.c