[PATCH] wifi: wl1251: Fix potential RX descriptor leak on probe failure
From: Guangshuo Li
Date: Wed Nov 11 2026 - 07:30:22 EST
wl1251_alloc_hw() allocates rx_descriptor separately from the mac80211
hardware. The SPI probe error path only frees the hardware, leaking the
descriptor.
Free the descriptor before releasing the hardware allocation.
This issue was found by our static analysis tool under development.
Fixes: 8e639c0673a9 ("wl1251: move module probe methods into spi.c")
Signed-off-by: Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx>
---
drivers/net/wireless/ti/wl1251/spi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
index 1936bb3af54a..418c42613fce 100644
--- a/drivers/net/wireless/ti/wl1251/spi.c
+++ b/drivers/net/wireless/ti/wl1251/spi.c
@@ -318,6 +318,7 @@ static int wl1251_spi_probe(struct spi_device *spi)
disable_regulator:
regulator_disable(wl->vio);
out_free:
+ kfree(wl->rx_descriptor);
ieee80211_free_hw(hw);
return ret;
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4