Skip to content

Commit

Permalink
wifi: rtlwifi: pci: wait for firmware loading before releasing memory
Browse files Browse the repository at this point in the history
mainline inclusion
from mainline-v6.14-rc1
category: bugfix

At probe error path, the firmware loading work may have already been
queued. In such a case, it will try to access memory allocated by the probe
function, which is about to be released. In such paths, wait for the
firmware worker to finish before releasing memory.

Fixes: 3d86b93 ("rtlwifi: Fix PCI probe error path orphaned memory")
Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
Signed-off-by: Ping-Ke Shih <[email protected]>
Link: https://patch.msgid.link/[email protected]
(cherry picked from commit b59b86c5d08be7d761c04affcbcec8184738c200)
Signed-off-by: Wentao Guan <[email protected]>
  • Loading branch information
Thadeu Lima de Souza Cascardo authored and opsiff committed Jan 26, 2025
1 parent 0d7e7c2 commit a6b7605
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/realtek/rtlwifi/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2220,6 +2220,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
fail4:
rtl_deinit_core(hw);
fail3:
wait_for_completion(&rtlpriv->firmware_loading_complete);
rtlpriv->cfg->ops->deinit_sw_vars(hw);

fail2:
Expand Down

0 comments on commit a6b7605

Please sign in to comment.