diff options
| author | Prateek Agarwal <praagarwal@nvidia.com> | 2025-09-19 13:25:40 +0900 |
|---|---|---|
| committer | Thierry Reding <treding@nvidia.com> | 2025-11-14 18:17:51 +0100 |
| commit | 6cbab9f0da72b4dc3c3f9161197aa3b9daa1fa3a (patch) | |
| tree | 006c13fc158ce0f3b89a1d32505f02c622f825cc /drivers | |
| parent | 4c5376b4b143c4834ebd392aef2215847752b16a (diff) | |
| download | net-6cbab9f0da72b4dc3c3f9161197aa3b9daa1fa3a.tar.gz | |
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
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/gpu/drm/tegra/uapi.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tegra/uapi.c b/drivers/gpu/drm/tegra/uapi.c index 5adab6b229164e..d0b6a1fa6efad9 100644 --- a/drivers/gpu/drm/tegra/uapi.c +++ b/drivers/gpu/drm/tegra/uapi.c @@ -114,9 +114,12 @@ int tegra_drm_ioctl_channel_open(struct drm_device *drm, void *data, struct drm_ if (err) goto put_channel; - if (supported) + if (supported) { + struct pid *pid = get_task_pid(current, PIDTYPE_TGID); context->memory_context = host1x_memory_context_alloc( - host, client->base.dev, get_task_pid(current, PIDTYPE_TGID)); + host, client->base.dev, pid); + put_pid(pid); + } if (IS_ERR(context->memory_context)) { if (PTR_ERR(context->memory_context) != -EOPNOTSUPP) { |
