]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
wireless: iwlwifi: Fix a double free in iwl_txq_dyn_alloc_dma
authorLv Yunlong <lyl2019@mail.ustc.edu.cn>
Sat, 3 Apr 2021 05:47:55 +0000 (22:47 -0700)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 09:59:24 +0000 (10:59 +0100)
commitefee4ea97a30194557ca672f20c5a18ed7db53e0
tree6b6ae98abba2b3ad0603209804d46ce33efe3ec6
parent6e275670d1e57e5bd0f514a9138abec77a64ae37
wireless: iwlwifi: Fix a double free in iwl_txq_dyn_alloc_dma

BugLink: https://bugs.launchpad.net/bugs/1959376
[ Upstream commit f973795a8d19cbf3d03807704eb7c6ff65788d5a ]

In iwl_txq_dyn_alloc_dma, txq->tfds is freed at first time by:
iwl_txq_alloc()->goto err_free_tfds->dma_free_coherent(). But
it forgot to set txq->tfds to NULL.

Then the txq->tfds is freed again in iwl_txq_dyn_alloc_dma by:
goto error->iwl_txq_gen2_free_memory()->dma_free_coherent().

My patch sets txq->tfds to NULL after the first free to avoid the
double free.

Fixes: 0cd1ad2d7fd41 ("iwlwifi: move all bus-independent TX functions to common code")
Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Link: https://lore.kernel.org/r/20210403054755.4781-1-lyl2019@mail.ustc.edu.cn
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/wireless/intel/iwlwifi/queue/tx.c