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>
This commit is contained in:
Jesper Juhl 2011-01-11 00:47:44 +01:00 committed by John W. Linville
parent 35b3ac470b
commit ccbd4d412d

View File

@ -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;
}