drm/tegra: fix device leak on probe()
PATCH 1/1 drm/tegra: fix device leak on probe()
Make sure to drop the reference taken when looking up the companion device during probe().
Note that holding a reference to a device does not prevent its driver data from going away so there is no point in keeping the reference.
Fixes f68ba6912bd2 ("drm/tegra: dc: Link DC1 to DC0 on Tegra20")
Cc [email protected] # 4.16
Cc Dmitry Osipenko <[email protected]>
Signed-off-by Johan Hovold <[email protected]>
--- drivers/gpu/drm/tegra/dc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/tegra/dc.c +2 -0
@@ -3148,6 +3148,8 @@ static int tegra_dc_couple(struct tegra_dc *dc) dc->client.parent = &parent->client;dev_dbg (dc->dev,"coupled to %s\n" ,dev_name (companion)); + +put_device (companion); }return 0 ;
Signature · 1 line
2.51.2
Quoted 19 lines · Johan Hovold
Make sure to drop the reference taken when looking up the companion device during
probe().Note that holding a reference to a device does not prevent its driver data from going away so there is no point in keeping the reference.
Fixes f68ba6912bd2 ("drm/tegra: dc: Link DC1 to DC0 on Tegra20")Cc [email protected] # 4.16Cc Dmitry Osipenko <[email protected]>Signed-off-by Johan Hovold <[email protected]>--- drivers/gpu/drm/tegra/dc.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/tegra/dc.c +0
-0
drivers/gpu/drm/tegra/dc.c static int tegra_dc_couple(struct tegra_dc *dc) · line 3152
Quoted 5 lines
drivers/gpu/drm/tegra/dc.c +2
-0@@ -3148,6 +3148,8 @@ static int tegra_dc_couple(struct tegra_dc *dc) dc->client.parent = &parent->client;dev_dbg (dc->dev,"coupled to %s\n" ,dev_name (companion)); + +put_device (companion);
I noticed that this has been fixed in rc7 when rebasing so please disregard this one.
Johan