diff options
author | Tom Rix <trix@redhat.com> | 2020-10-04 06:19:31 -0700 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2020-10-08 13:46:25 +0300 |
commit | 53708f4fd9cfe389beab5c8daa763bcd0e0b4aef (patch) | |
tree | 7c6a0d0b26d7af7b992cbb0b8319fe755780f34d /drivers/net/wireless/intel/iwlwifi/mvm/ops.c | |
parent | 8431350eee2e27ae60f5250e0437ab298329070e (diff) | |
download | linux-53708f4fd9cfe389beab5c8daa763bcd0e0b4aef.tar.gz linux-53708f4fd9cfe389beab5c8daa763bcd0e0b4aef.tar.bz2 linux-53708f4fd9cfe389beab5c8daa763bcd0e0b4aef.zip |
mwifiex: fix double free
clang static analysis reports this problem:
sdio.c:2403:3: warning: Attempt to free released memory
kfree(card->mpa_rx.buf);
^~~~~~~~~~~~~~~~~~~~~~~
When mwifiex_init_sdio() fails in its first call to
mwifiex_alloc_sdio_mpa_buffer, it falls back to calling it
again. If the second alloc of mpa_tx.buf fails, the error
handler will try to free the old, previously freed mpa_rx.buf.
Reviewing the code, it looks like a second double free would
happen with mwifiex_cleanup_sdio().
So set both pointers to NULL when they are freed.
Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201004131931.29782-1-trix@redhat.com
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/ops.c')
0 files changed, 0 insertions, 0 deletions