wil6210: fix RX buffers release and unmap
authorMaya Erez <merez@codeaurora.org>
Thu, 23 Aug 2018 11:47:11 +0000 (14:47 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:08:30 +0000 (11:08 -0800)
commitb83452446e079fd6238c94a593876f4c1cb1dd86
tree7cb6cab83a78b5ae86d92b29482f7defeead8f83
parentef172c741586382ecce429007e66f4d4700a6b69
wil6210: fix RX buffers release and unmap

[ Upstream commit 84f16fbb62384fb209cd35741d94eb00b5ca2746 ]

RX SKBs are released in both wil6210 rmmod and RX handle.
As there is no lock to protect the buffers DMA unmap,
the SKB pointer in buff_arr is used to check if the buffer
memory was already released.
Setting wil->rx_buff_mgmt.buff_arr[buff_id].skb to NULL before the DMA
memory unmap will prevent duplicate unmapping of the same memory.
Move the buffer ID to the free list also in case the SKB is NULL.

Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/ath/wil6210/txrx_edma.c