Skip to contentSkip to conversation

amba: tegra-ahb: fix device leak on smmu enable

PATCH Applied Johan Hovold 3 participants 4 messages Sep 25, 2025 – Nov 14, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 amba: tegra-ahb: fix device leak on smmu enable

Make sure to drop the reference taken to the ahb platform device when looking up its driver data while enabling the smmu.

Note that holding a reference to a device does not prevent its driver data from going away.

Fixes 89c788bab1f0 ("ARM: tegra: Add SMMU enabler in AHB")
---
 drivers/amba/tegra-ahb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/amba/tegra-ahb.c +1 -0
index c0e8b765522d..f23c3ed01810 100644
@@ -144,6 +144,7 @@ int tegra_ahb_enable_smmu(struct device_node *dn)
 	if (!dev)
 		return -EPROBE_DEFER;
 	ahb = dev_get_drvdata(dev);
+	put_device(dev);
 	val = gizmo_readl(ahb, AHB_ARBITRATION_XBAR_CTRL);
 	val |= AHB_ARBITRATION_XBAR_CTRL_SMMU_INIT_DONE;
 	gizmo_writel(ahb, val, AHB_ARBITRATION_XBAR_CTRL);
Signature · 1 line
2.49.1
#2 lore raw
In reply to Johan Hovold
Quoted 10 lines · Johan Hovold

Make sure to drop the reference taken to the ahb platform device when looking up its driver data while enabling the smmu.

Note that holding a reference to a device does not prevent its driver data from going away.

Fixes 89c788bab1f0 ("ARM: tegra: Add SMMU enabler in AHB")

---

Can this one be picked up for 6.19?

Johan

#3 lore raw
In reply to Johan Hovold
Quoted 6 lines · Johan Hovold

Make sure to drop the reference taken to the ahb platform device when looking up its driver data while enabling the smmu.

Note that holding a reference to a device does not prevent its driver data from going away.

Quoted 6 lines
Fixes 89c788bab1f0 ("ARM: tegra: Add SMMU enabler in AHB")
---
 drivers/amba/tegra-ahb.c | 1 +
 1 file changed, 1 insertion(+)

Applied, thanks.

Thierry