summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2011-01-11 00:47:44 +0100
committerJohn W. Linville <linville@tuxdriver.com>2011-01-13 21:46:45 +0100
commitccbd4d412dde4b7e858159e5cc8ba7ee4a6cac07 (patch)
tree1c711402283c1ff21bd35d44aa8b49836ad71f6b
parentiwmc3200wifi: Return proper error for iwm_if_alloc (diff)
downloadlinux-ccbd4d412dde4b7e858159e5cc8ba7ee4a6cac07.tar.xz
linux-ccbd4d412dde4b7e858159e5cc8ba7ee4a6cac07.zip
rt2x00: Don't leak mem in error path of rt2x00lib_request_firmware()
We need to release_firmware() in order not to leak memory. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00firmware.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00firmware.c b/drivers/net/wireless/rt2x00/rt2x00firmware.c
index f0e1eb72befc..be0ff78c1b16 100644
--- a/drivers/net/wireless/rt2x00/rt2x00firmware.c
+++ b/drivers/net/wireless/rt2x00/rt2x00firmware.c
@@ -58,6 +58,7 @@ static int rt2x00lib_request_firmware(struct rt2x00_dev *rt2x00dev)
if (!fw || !fw->size || !fw->data) {
ERROR(rt2x00dev, "Failed to read Firmware.\n");
+ release_firmware(fw);
return -ENOENT;
}