wifi: rtw88: add missing unwind goto for __rtw_download_firmware()
Ping-Ke Shih
maintainerPATCH 1/1 wifi: rtw88: add missing unwind goto for __rtw_download_firmware()
This flaw is detected by smatch:
drivers/net/wireless/realtek/rtw88/mac.c:748 __rtw_download_firmware()
warn: missing unwind goto?
Though most things of dlfw_fail have been done by download_firmware_end_flow() and wlan_cpu_enable(), an exception is that download_firmware_end_flow() clear BIT_MCUFWDL_EN bit conditionally. So, make this change to clear the bit.
--- drivers/net/wireless/realtek/rtw88/mac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw88/mac.c +4 -2
@@ -794,8 +794,10 @@ static int __rtw_download_firmware(struct rtw_dev *rtwdev,wlan_cpu_enable (rtwdev, true); -if (!ltecoex_reg_write (rtwdev,0x38 , ltecoex_bckp)) -return -EBUSY ; +if (!ltecoex_reg_write (rtwdev,0x38 , ltecoex_bckp)) { + ret = -EBUSY ; + goto dlfw_fail; + } ret =download_firmware_validate (rtwdev);if (ret)
Signature · 1 line
2.25.1
Quoted 9 lines · Ping-Ke Shih
This flaw is detected by smatch:
drivers/net/wireless/realtek/rtw88/mac.c:748__rtw_download_firmware()
warn: missing unwind goto?Though most things of
dlfw_failhave been done bydownload_firmware_end_flow()andwlan_cpu_enable(), an exception is thatdownload_firmware_end_flow()clearBIT_MCUFWDL_ENbit conditionally. So, make this change to clear the bit.
Quoted 5 lines
Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Cc Sascha Hauer <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>
Patch applied to wireless-next.git, thanks.
91ccdbb94fea wifi: rtw88: add missing unwind goto for __rtw_download_firmware()
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches