drm/tegra: dsi: fix device leak on probe
PATCH 1/1 drm/tegra: dsi: fix device leak on probe
Make sure to drop the reference taken when looking up the companion (ganged) device and its driver data 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.
--- drivers/gpu/drm/tegra/dsi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/tegra/dsi.c +2 -4
@@ -1549,11 +1549,9 @@ static int tegra_dsi_ganged_probe(struct tegra_dsi *dsi)return -EPROBE_DEFER ; dsi->slave =platform_get_drvdata (gangster); - -if (!dsi->slave) { -put_device (&gangster->dev); +put_device (&gangster->dev); +if (!dsi->slave)return -EPROBE_DEFER ; - } dsi->slave->master = dsi; }
Signature · 1 line
2.51.2
Quoted 11 lines · Johan Hovold
Make sure to drop the reference taken when looking up the companion (ganged) device and its driver data 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 e94236cde4d5 ("drm/tegra: dsi: Add ganged mode support")Fixes 221e3638feb8 ("drm/tegra: Fix reference leak in tegra_dsi_ganged_probe")Cc [email protected] # 3.19: 221e3638feb8Cc Thierry Reding <[email protected]>Signed-off-by Johan Hovold <[email protected]>
Can this one be picked up now?
Johan
Quoted 7 lines · Johan Hovold
Quoted 6 lines · Johan Hovold
Make sure to drop the reference taken when looking up the companion (ganged) device and its driver data 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.
Quoted 7 lines
Quoted 5 lines
Fixes e94236cde4d5 ("drm/tegra: dsi: Add ganged mode support")Fixes 221e3638feb8 ("drm/tegra: Fix reference leak in tegra_dsi_ganged_probe")Cc [email protected] # 3.19: 221e3638feb8Cc Thierry Reding <[email protected]>Signed-off-by Johan Hovold <[email protected]>Can this one be picked up now?
Sorry, forgot to notify you earlier that I've picked this up into drm-misc-next.
Thierry
Quoted 14 lines · Thierry Reding
Quoted 13 lines · Johan Hovold
Quoted 11 lines · Johan Hovold
Make sure to drop the reference taken when looking up the companion (ganged) device and its driver data 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 e94236cde4d5 ("drm/tegra: dsi: Add ganged mode support")Fixes 221e3638feb8 ("drm/tegra: Fix reference leak in tegra_dsi_ganged_probe")Cc [email protected] # 3.19: 221e3638feb8Cc Thierry Reding <[email protected]>Signed-off-by Johan Hovold <[email protected]>
Quoted 4 lines
Quoted 1 line
Can this one be picked up now?
Sorry, forgot to notify you earlier that I've picked this up into drm-misc-next.
No worries, I noticed this morning when looking at linux-next.
Thanks!
Johan