]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtlwifi: pci: wait for firmware loading before releasing memory
authorThadeu Lima de Souza Cascardo <cascardo@igalia.com>
Fri, 6 Dec 2024 17:37:13 +0000 (14:37 -0300)
committerPing-Ke Shih <pkshih@realtek.com>
Thu, 12 Dec 2024 02:35:20 +0000 (10:35 +0800)
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: 3d86b93064c7 ("rtlwifi: Fix PCI probe error path orphaned memory")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20241206173713.3222187-5-cascardo@igalia.com
drivers/net/wireless/realtek/rtlwifi/pci.c

index a870117cf12af0da3ef5b2ed0f7de13995b7fc49..0eafc4d125f91dffd06f8baaf7aa2bd258b7ea74 100644 (file)
@@ -2218,6 +2218,7 @@ fail5:
 fail4:
        rtl_deinit_core(hw);
 fail3:
+       wait_for_completion(&rtlpriv->firmware_loading_complete);
        rtlpriv->cfg->ops->deinit_sw_vars(hw);
 
 fail2: