wifi: rtlwifi: rtl8192se: rise completion of firmware loading as last step
[ Upstream commit8559a9e0c4] Just like in commit4dfde294b9("rtlwifi: rise completion at the last step of firmware callback"), only signal completion once the function is finished. Otherwise, the module removal waiting for the completion could free the memory that the callback will still use before returning. Fixes:b0302aba81("rtlwifi: Convert to asynchronous firmware load") Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20241107133322.855112-3-cascardo@igalia.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f5dad52e01
commit
1faa2647a0
@@ -68,22 +68,23 @@ static void rtl92se_fw_cb(const struct firmware *firmware, void *context)
|
||||
|
||||
rtl_dbg(rtlpriv, COMP_ERR, DBG_LOUD,
|
||||
"Firmware callback routine entered!\n");
|
||||
complete(&rtlpriv->firmware_loading_complete);
|
||||
if (!firmware) {
|
||||
pr_err("Firmware %s not available\n", fw_name);
|
||||
rtlpriv->max_fw_size = 0;
|
||||
return;
|
||||
goto exit;
|
||||
}
|
||||
if (firmware->size > rtlpriv->max_fw_size) {
|
||||
pr_err("Firmware is too big!\n");
|
||||
rtlpriv->max_fw_size = 0;
|
||||
release_firmware(firmware);
|
||||
return;
|
||||
goto exit;
|
||||
}
|
||||
pfirmware = (struct rt_firmware *)rtlpriv->rtlhal.pfirmware;
|
||||
memcpy(pfirmware->sz_fw_tmpbuffer, firmware->data, firmware->size);
|
||||
pfirmware->sz_fw_tmpbufferlen = firmware->size;
|
||||
release_firmware(firmware);
|
||||
exit:
|
||||
complete(&rtlpriv->firmware_loading_complete);
|
||||
}
|
||||
|
||||
static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
|
||||
|
||||
Reference in New Issue
Block a user