Linux Tegra architecture development
 help / color / mirror / Atom feed
* [PATCH v2] drm/tegra: fix host1x_bo_pin leak in tegra_dc_pin error path
@ 2026-06-28 15:02 WenTao Liang
  2026-06-29  5:59 ` Mikko Perttunen
  0 siblings, 1 reply; 3+ messages in thread
From: WenTao Liang @ 2026-06-28 15:02 UTC (permalink / raw)
  To: thierry.reding, mperttunen, airlied, simona, jonathanh
  Cc: dri-devel, linux-tegra, linux-kernel, WenTao Liang, Greg KH,
	stable

When map->chunks > 1 triggers an error, the function jumps to unpin
before storing the current map in state->map[i]. The unpin loop only
cleans up previously pinned planes (indices 0 through i-1), so the
current mapping returned by host1x_bo_pin is never released via
host1x_bo_unpin.

Suggested-by: Greg KH <gregkh@linuxfoundation.org>
Fixes: c6aeaf56f468 ("drm/tegra: Implement correct DMA-BUF semantics")
Cc: stable@vger.kernel.org
Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
---
Changes in v2:
- Fix patch format based on reviewer feedback
---
 drivers/gpu/drm/tegra/plane.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
index 0cb30910773f..e61485ee58f6 100644
--- a/drivers/gpu/drm/tegra/plane.c
+++ b/drivers/gpu/drm/tegra/plane.c
@@ -161,6 +161,7 @@ static int tegra_dc_pin(struct tegra_dc *dc, struct tegra_plane_state *state)
 			 */
 			if (map->chunks > 1) {
 				err = -EINVAL;
+				host1x_bo_unpin(map);
 				goto unpin;
 			}
 
-- 
2.39.5 (Apple Git-154)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-30  9:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-28 15:02 [PATCH v2] drm/tegra: fix host1x_bo_pin leak in tegra_dc_pin error path WenTao Liang
2026-06-29  5:59 ` Mikko Perttunen
2026-06-30  9:19   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox