RE: [PATCH wireless] wifi: rtw88: pci: fix resource leak on failed NAPI setup

From: Ping-Ke Shih

Date: Wed Jun 17 2026 - 04:35:08 EST


Dawei Feng <dawei.feng@xxxxxxxxxx> wrote:
> rtw_pci_probe() allocates PCI resources through
> rtw_pci_setup_resource() before it sets up NAPI. If
> rtw_pci_napi_init() fails, the error path jumps straight to
> err_pci_declaim and skips rtw_pci_destroy(), leaving the PCI
> resources allocated by rtw_pci_setup_resource() behind.
>
> Add a dedicated cleanup label for the NAPI setup failure path so probe
> destroys the PCI resources.
>
> The bug was first flagged by an experimental analysis tool we are
> developing for kernel memory-management bugs while analyzing current
> mainline kernels. The tool is still under development and is not yet
> publicly available. Manual inspection confirms that the bug is still
> present in v7.1-rc7.
>
> An x86_64 allyesconfig build showed no new warnings. As we do not have a
> suitable rtw88 PCI board to test with, no runtime testing was able to be
> performed.
>
> Fixes: d0bcb10e7b94 ("wifi: rtw88: Un-embed dummy device")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Dawei Feng <dawei.feng@xxxxxxxxxx>

Acked-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>