mirror of
https://github.com/torvalds/linux.git
synced 2024-11-08 13:11:45 +00:00
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:
parent
35b3ac470b
commit
ccbd4d412d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user