From: Jesper Juhl Date: Mon, 10 Jan 2011 23:47:44 +0000 (+0100) Subject: rt2x00: Don't leak mem in error path of rt2x00lib_request_firmware() X-Git-Tag: v2.6.38-rc3~29^2~4^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ccbd4d412dde4b7e858159e5cc8ba7ee4a6cac07;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git 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 Acked-by: Ivo van Doorn Acked-by: Pekka Enberg Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/rt2x00/rt2x00firmware.c b/drivers/net/wireless/rt2x00/rt2x00firmware.c index f0e1eb7..be0ff78 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; }