[PATCH] wifi: ath12k: Fix rproc reference leak when configuring rproc IRQs

Wentao Liang posted 1 patch 1 week ago
drivers/net/wireless/ath/ath12k/ahb.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
[PATCH] wifi: ath12k: Fix rproc reference leak when configuring rproc IRQs
Posted by Wentao Liang 1 week ago
ath12k_ahb_configure_rproc() returns the result of
ath12k_ahb_config_rproc_irq() directly, so a failure there leaves the
rproc notifier registered and the rproc reference taken by
ath12k_ahb_get_rproc() unreleased. Route this failure through the error
path that unregisters the notifier and drops the reference.

Fixes: 10a355ba6238 ("wifi: ath12k: Power up root PD")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/net/wireless/ath/ath12k/ahb.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/ahb.c b/drivers/net/wireless/ath/ath12k/ahb.c
index 2dcf0a52e4c1..0b69ff42dd7a 100644
--- a/drivers/net/wireless/ath/ath12k/ahb.c
+++ b/drivers/net/wireless/ath/ath12k/ahb.c
@@ -889,7 +889,11 @@ static int ath12k_ahb_configure_rproc(struct ath12k_base *ab)
 		}
 	}
 
-	return ath12k_ahb_config_rproc_irq(ab);
+	ret = ath12k_ahb_config_rproc_irq(ab);
+	if (ret < 0)
+		goto err_unreg_notifier;
+
+	return 0;
 
 err_unreg_notifier:
 	ath12k_ahb_unregister_rproc_notifier(ab);
-- 
2.34.1