Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/tegra: Add call to put_pid()

Add a call to put_pid() corresponding to get_task_pid().
host1x_memory_context_alloc() does not take ownership of the PID so we
need to free it here to avoid leaking.

Signed-off-by: Prateek Agarwal <praagarwal@nvidia.com>
Fixes: e09db97889ec ("drm/tegra: Support context isolation")
[mperttunen@nvidia.com: reword commit message]
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/20250919-host1x-put-pid-v1-1-19c2163dfa87@nvidia.com

authored by

Prateek Agarwal and committed by
Thierry Reding
6cbab9f0 4c5376b4

+5 -2
+5 -2
drivers/gpu/drm/tegra/uapi.c
··· 114 114 if (err) 115 115 goto put_channel; 116 116 117 - if (supported) 117 + if (supported) { 118 + struct pid *pid = get_task_pid(current, PIDTYPE_TGID); 118 119 context->memory_context = host1x_memory_context_alloc( 119 - host, client->base.dev, get_task_pid(current, PIDTYPE_TGID)); 120 + host, client->base.dev, pid); 121 + put_pid(pid); 122 + } 120 123 121 124 if (IS_ERR(context->memory_context)) { 122 125 if (PTR_ERR(context->memory_context) != -EOPNOTSUPP) {