Commit 6cbab9f0 authored by Prateek Agarwal's avatar Prateek Agarwal Committed by Thierry Reding
Browse files

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: default avatarPrateek Agarwal <praagarwal@nvidia.com>
Fixes: e09db978 ("drm/tegra: Support context isolation")
[mperttunen@nvidia.com: reword commit message]
Signed-off-by: default avatarMikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/20250919-host1x-put-pid-v1-1-19c2163dfa87@nvidia.com
parent 4c5376b4
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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) {