Skip to content

Commit 4c5376b

Browse files
Ma Kethierryreding
authored andcommitted
drm/tegra: dc: Fix reference leak in tegra_dc_couple()
driver_find_device() calls get_device() to increment the reference count once a matching device is found, but there is no put_device() to balance the reference count. To avoid reference count leakage, add put_device() to decrease the reference count. Found by code review. Cc: stable@vger.kernel.org Fixes: a31500f ("drm/tegra: dc: Restore coupling of display controllers") Signed-off-by: Ma Ke <make24@iscas.ac.cn> Acked-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patch.msgid.link/20251022114720.24937-1-make24@iscas.ac.cn
1 parent 0a4a18e commit 4c5376b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • drivers/gpu/drm/tegra

drivers/gpu/drm/tegra/dc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3148,6 +3148,7 @@ static int tegra_dc_couple(struct tegra_dc *dc)
31483148
dc->client.parent = &parent->client;
31493149

31503150
dev_dbg(dc->dev, "coupled to %s\n", dev_name(companion));
3151+
put_device(companion);
31513152
}
31523153

31533154
return 0;

0 commit comments

Comments
 (0)