Skip to contentSkip to conversation

drm/tegra: Fix reference count leak in tegra_dc_couple

PATCH New Miaoqian Lin 1 participant 1 message Oct 27, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/tegra: Fix reference count leak in tegra_dc_couple

The driver_find_device() function returns a device with its reference count incremented. The caller is responsible for calling put_device() to release this reference when done. Fix this leak by adding the missing put_device() call.

Found via static analysis.

Fixes f68ba6912bd2 ("drm/tegra: dc: Link DC1 to DC0 on Tegra20")
---
 drivers/gpu/drm/tegra/dc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/tegra/dc.c +1 -0
index 59d5c1ba145a..6c84bd69b11f 100644
@@ -3148,6 +3148,7 @@ 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.39.5 (Apple Git-154)