mirror of
https://github.com/torvalds/linux.git
synced 2025-11-08 04:30:00 +02:00
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:
|
||
|---|---|---|
| .. | ||
| libertas | ||
| libertas_tf | ||
| mwifiex | ||
| Kconfig | ||
| Makefile | ||
| mwl8k.c | ||