Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH] wifi: rtw88: Unregister all hardware state when PCI IRQ setup fails
@ 2026-12-05  9:54 Shuo Qin
  2026-12-05 16:13 ` Luka Gejak
  0 siblings, 1 reply; 2+ messages in thread
From: Shuo Qin @ 2026-12-05  9:54 UTC (permalink / raw)
  To: Ping-Ke Shih
  Cc: Bitterblue Smith, linux-wireless, stable, linux-kernel, Bin Yu,
	Cheng Wen, XinCheng Wang

rtw_register_hw() registers the LED class device and creates debugfs
entries as well as registering the mac80211 hardware. If the following
IRQ request fails, rtw_pci_probe() only calls ieee80211_unregister_hw()
before freeing the hardware and its private driver state.

The LED remains registered with callbacks that access the freed rtw_dev.
Use rtw_unregister_hw() to undo the complete registration, including the
LED and debugfs state, before releasing the allocation.

Fixes: 4b6652bc6d8d ("wifi: rtw88: Add support for LED blinking")
Cc: stable@vger.kernel.org
Co-developed-by: Bin Yu <byu@xidian.edu.cn>
Signed-off-by: Bin Yu <byu@xidian.edu.cn>
Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Shuo Qin <23159100078@stu.xidian.edu.cn>
---
 drivers/net/wireless/realtek/rtw88/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
index 66d2e5f514447b9779d1f58f8fe9a4a647df7850..e6ee32d59c11ced61223d0f26523cf091aaf3bea 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -1897,7 +1897,7 @@ int rtw_pci_probe(struct pci_dev *pdev,
 
 	ret = rtw_pci_request_irq(rtwdev, pdev);
 	if (ret) {
-		ieee80211_unregister_hw(hw);
+		rtw_unregister_hw(rtwdev, hw);
 		goto err_destroy_pci;
 	}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wifi: rtw88: Unregister all hardware state when PCI IRQ setup fails
  2026-12-05  9:54 [PATCH] wifi: rtw88: Unregister all hardware state when PCI IRQ setup fails Shuo Qin
@ 2026-12-05 16:13 ` Luka Gejak
  0 siblings, 0 replies; 2+ messages in thread
From: Luka Gejak @ 2026-12-05 16:13 UTC (permalink / raw)
  To: Shuo Qin, Ping-Ke Shih
  Cc: Bitterblue Smith, linux-wireless, stable, linux-kernel, Bin Yu,
	Cheng Wen, XinCheng Wang

Hi Shuo,

The prefered prefix for rtw next related patches is [PATCH rtw-next]
instead of plain [PATCH]. I do not think it is worth sending v2 for this,
but keep it in mind for future submissions.

December 5, 2026 at 10:54 AM, "Shuo Qin" <23159100078@stu.xidian.edu.cn> wrote:
> 
> rtw_register_hw() registers the LED class device and creates debugfs
> entries as well as registering the mac80211 hardware. If the following
> IRQ request fails, rtw_pci_probe() only calls ieee80211_unregister_hw()
> before freeing the hardware and its private driver state.
> 
> The LED remains registered with callbacks that access the freed rtw_dev.
> Use rtw_unregister_hw() to undo the complete registration, including the
> LED and debugfs state, before releasing the allocation.
> 
> Fixes: 4b6652bc6d8d ("wifi: rtw88: Add support for LED blinking")
> Cc: stable@vger.kernel.org
> Co-developed-by: Bin Yu <byu@xidian.edu.cn>
> Signed-off-by: Bin Yu <byu@xidian.edu.cn>
> Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
> Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
> Signed-off-by: Shuo Qin <23159100078@stu.xidian.edu.cn>
> ---

Looks good to me,

Reviewed-by: Luka Gejak <luka.gejak@linux.dev>

Best regards,
Luka Gejak

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-05 16:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05  9:54 [PATCH] wifi: rtw88: Unregister all hardware state when PCI IRQ setup fails Shuo Qin
2026-12-05 16:13 ` Luka Gejak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox