alistair23-linux/drivers/net/wireless/rsi
Mike Looijmans 5d5cd85ff4 rsi: Fix failure to load firmware after memory leak fix and fix the leak
Fixes commit eae79b4f3e ("rsi: fix memory leak in rsi_load_ta_instructions()")
which stopped the driver from functioning.

Firmware data has been allocated using vmalloc(), resulting in memory
that cannot be used for DMA. Hence the firmware was first copied to a
buffer allocated with kmalloc() in the original code. This patch reverts
the commit and only calls "kfree()" to release the buffer after sending
the data. This fixes the memory leak without breaking the driver.

Add a comment to the kmemdup() calls to explain why this is done, and abort
if memory allocation fails.

Tested on a Topic Miami-Florida board which contains the rsi SDIO chip.

Also added the same kfree() call to the USB glue driver. This was not
tested on actual hardware though, as I only have the SDIO version.

Fixes: eae79b4f3e ("rsi: fix memory leak in rsi_load_ta_instructions()")
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Cc: stable@vger.kernel.org
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-31 09:22:44 +03:00
..
Kconfig
Makefile
rsi_91x_core.c
rsi_91x_debugfs.c
rsi_91x_mac80211.c
rsi_91x_main.c
rsi_91x_mgmt.c
rsi_91x_pkt.c
rsi_91x_sdio.c
rsi_91x_sdio_ops.c rsi: Fix failure to load firmware after memory leak fix and fix the leak 2015-07-31 09:22:44 +03:00
rsi_91x_usb.c
rsi_91x_usb_ops.c rsi: Fix failure to load firmware after memory leak fix and fix the leak 2015-07-31 09:22:44 +03:00
rsi_boot_params.h
rsi_common.h
rsi_debugfs.h
rsi_main.h
rsi_mgmt.h
rsi_sdio.h
rsi_usb.h