Netdev List
 help / color / mirror / Atom feed
* [PATCH] net: ipa: fix SMEM state handle leaks in SMP2P init
@ 2026-06-23  3:18 Haoxiang Li
  2026-06-23 15:53 ` Alex Elder
  0 siblings, 1 reply; 3+ messages in thread
From: Haoxiang Li @ 2026-06-23  3:18 UTC (permalink / raw)
  To: elder, andrew+netdev, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Haoxiang Li, stable

ipa_smp2p_init() acquires two Qualcomm SMEM state handles with
qcom_smem_state_get(). However, neither the init error paths
nor ipa_smp2p_exit() release them.

Use devm_qcom_smem_state_get() for both state handles so the
references are released automatically when the platform device
is removed.

Fixes: 530f9216a953 ("soc: qcom: ipa: AP/modem communications")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
---
 drivers/net/ipa/ipa_smp2p.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ipa/ipa_smp2p.c b/drivers/net/ipa/ipa_smp2p.c
index 2f0ccdd937cc..d8fd56949082 100644
--- a/drivers/net/ipa/ipa_smp2p.c
+++ b/drivers/net/ipa/ipa_smp2p.c
@@ -228,15 +228,15 @@ ipa_smp2p_init(struct ipa *ipa, struct platform_device *pdev, bool modem_init)
 	u32 valid_bit;
 	int ret;
 
-	valid_state = qcom_smem_state_get(dev, "ipa-clock-enabled-valid",
-					  &valid_bit);
+	valid_state = devm_qcom_smem_state_get(dev, "ipa-clock-enabled-valid",
+					       &valid_bit);
 	if (IS_ERR(valid_state))
 		return PTR_ERR(valid_state);
 	if (valid_bit >= 32)		/* BITS_PER_U32 */
 		return -EINVAL;
 
-	enabled_state = qcom_smem_state_get(dev, "ipa-clock-enabled",
-					    &enabled_bit);
+	enabled_state = devm_qcom_smem_state_get(dev, "ipa-clock-enabled",
+						 &enabled_bit);
 	if (IS_ERR(enabled_state))
 		return PTR_ERR(enabled_state);
 	if (enabled_bit >= 32)		/* BITS_PER_U32 */
-- 
2.25.1


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

end of thread, other threads:[~2026-06-23 21:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-23  3:18 [PATCH] net: ipa: fix SMEM state handle leaks in SMP2P init Haoxiang Li
2026-06-23 15:53 ` Alex Elder
2026-06-23 21:06   ` Jakub Kicinski

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