summaryrefslogtreecommitdiff
path: root/drivers/amba
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2025-09-25 17:00:07 +0200
committerThierry Reding <treding@nvidia.com>2025-11-14 17:49:12 +0100
commit500e1368e46928f4b2259612dcabb6999afae2a6 (patch)
tree94eaa6eab51dd0695e153457ede0d6cc6029819b /drivers/amba
parent3a8660878839faadb4f1a6dd72c3179c1df56787 (diff)
downloadlinux-next-500e1368e46928f4b2259612dcabb6999afae2a6.tar.gz
linux-next-500e1368e46928f4b2259612dcabb6999afae2a6.zip
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") Cc: stable@vger.kernel.org # 3.5 Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/amba')
-rw-r--r--drivers/amba/tegra-ahb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/amba/tegra-ahb.c b/drivers/amba/tegra-ahb.c
index c0e8b765522d..f23c3ed01810 100644
--- a/drivers/amba/tegra-ahb.c
+++ b/drivers/amba/tegra-ahb.c
@@ -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);