rsi: Fix possible leak when loading firmware
authorChristian Engelmayer <cengelma@gmx.at>
Fri, 21 Aug 2015 21:14:26 +0000 (23:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Oct 2015 21:43:24 +0000 (14:43 -0700)
commita58897f9e663bb9b64b703f7dd451c7089cb28bb
treeafc8bcf91cd8fd00331464c80a33fffff597740b
parente6b5ff2bbb2f2b10860efaa052783eeaa3cd257d
rsi: Fix possible leak when loading firmware

commit a8b9774571d46506a0774b1ced3493b1245cf893 upstream.

Commit 5d5cd85ff441 ("rsi: Fix failure to load firmware after memory
leak fix and fix the leak") also added a check on the allocation of
DMA-accessible memory that may directly return. In that case the
already allocated firmware data is leaked. Make sure the data is
always freed correctly. Detected by Coverity CID 1316519.

Fixes: 5d5cd85ff441 ("rsi: Fix failure to load firmware after memory leak fix and fix the leak")
Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
drivers/net/wireless/rsi/rsi_91x_usb_ops.c