]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
mwl8k: Fix a double Free in mwl8k_probe_hw
authorLv Yunlong <lyl2019@mail.ustc.edu.cn>
Fri, 2 Apr 2021 18:26:27 +0000 (11:26 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 26 May 2021 13:39:22 +0000 (15:39 +0200)
commitaabedb30e2b81ae2810959c096da458b771806c3
tree3f53ee0bdf22f634fd6af806baaac5f46d634523
parente16b5704f0dc38e23fe24b5f43d3fdd6f0efc9e1
mwl8k: Fix a double Free in mwl8k_probe_hw

BugLink: https://bugs.launchpad.net/bugs/1929615
[ Upstream commit a8e083ee8e2a6c94c29733835adae8bf5b832748 ]

In mwl8k_probe_hw, hw->priv->txq is freed at the first time by
dma_free_coherent() in the call chain:
if(!priv->ap_fw)->mwl8k_init_txqs(hw)->mwl8k_txq_init(hw, i).

Then in err_free_queues of mwl8k_probe_hw, hw->priv->txq is freed
at the second time by mwl8k_txq_deinit(hw, i)->dma_free_coherent().

My patch set txq->txd to NULL after the first free to avoid the
double free.

Fixes: a66098daacee2 ("mwl8k: Marvell TOPDOG wireless driver")
Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210402182627.4256-1-lyl2019@mail.ustc.edu.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/wireless/marvell/mwl8k.c