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-Url: https://git.stricted.de/?a=commitdiff_plain;h=ccbd4d412dde4b7e858159e5cc8ba7ee4a6cac07;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.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 f0e1eb72bef..be0ff78c1b1 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; }