Skip to content

Commit

Permalink
drm/tegra: Fix reference leak in tegra_dsi_ganged_probe
Browse files Browse the repository at this point in the history
The reference taken by 'of_find_device_by_node()' must be released when
not needed anymore. Add put_device() call to fix this.

Fixes: e94236c ("drm/tegra: dsi: Add ganged mode support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
  • Loading branch information
Miaoqian Lin authored and Thierry Reding committed Feb 25, 2022
1 parent f07f04a commit 221e363
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/tegra/dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,8 +1538,10 @@ static int tegra_dsi_ganged_probe(struct tegra_dsi *dsi)
dsi->slave = platform_get_drvdata(gangster);
of_node_put(np);

if (!dsi->slave)
if (!dsi->slave) {
put_device(&gangster->dev);
return -EPROBE_DEFER;
}

dsi->slave->master = dsi;
}
Expand Down

0 comments on commit 221e363

Please sign in to comment.