mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
mwl8k: Fix a double Free in mwl8k_probe_hw
[ Upstream commita8e083ee8e] 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:a66098daac("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>
This commit is contained in:
parent
87299aad62
commit
1dd5ac62c0
|
|
@ -1469,6 +1469,7 @@ static int mwl8k_txq_init(struct ieee80211_hw *hw, int index)
|
||||||
txq->skb = kcalloc(MWL8K_TX_DESCS, sizeof(*txq->skb), GFP_KERNEL);
|
txq->skb = kcalloc(MWL8K_TX_DESCS, sizeof(*txq->skb), GFP_KERNEL);
|
||||||
if (txq->skb == NULL) {
|
if (txq->skb == NULL) {
|
||||||
pci_free_consistent(priv->pdev, size, txq->txd, txq->txd_dma);
|
pci_free_consistent(priv->pdev, size, txq->txd, txq->txd_dma);
|
||||||
|
txq->txd = NULL;
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user