[PATCH] wifi: wcn36xx: Fix tx-enable state leak in platform_get_resources()
Wentao Liang
vulab at iscas.ac.cn
Thu Sep 17 05:07:05 PDT 2026
wcn36xx_platform_get_resources() gets the "tx-enable" smem state, which
holds a reference, but only the wcn36xx_remove() path releases it. The
reference is leaked when the tx-rings-empty state cannot be acquired and
on every error path after that. Release it there, and route the missing
"qcom,mmio" property to the common cleanup label so all error paths drop
it.
Fixes: f303a9311065 ("wcn36xx: Transition driver to SMD client")
Cc: stable at vger.kernel.org
Signed-off-by: Wentao Liang <vulab at iscas.ac.cn>
---
drivers/net/wireless/ath/wcn36xx/main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index c3f0860873de..f34d64464f64 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -1502,13 +1502,15 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn,
"tx-rings-empty", &wcn->tx_rings_empty_state_bit);
if (IS_ERR(wcn->tx_rings_empty_state)) {
wcn36xx_err("failed to get tx-rings-empty state\n");
+ qcom_smem_state_put(wcn->tx_enable_state);
return PTR_ERR(wcn->tx_rings_empty_state);
}
mmio_node = of_parse_phandle(pdev->dev.parent->of_node, "qcom,mmio", 0);
if (!mmio_node) {
wcn36xx_err("failed to acquire qcom,mmio reference\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto put_mmio_node;
}
wcn->is_pronto = !!of_device_is_compatible(mmio_node, "qcom,pronto");
@@ -1552,6 +1554,7 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn,
iounmap(wcn->ccu_base);
put_mmio_node:
of_node_put(mmio_node);
+ qcom_smem_state_put(wcn->tx_enable_state);
return ret;
}
--
2.34.1
More information about the wcn36xx
mailing list