Skip to content

Commit 6cbab9f

Browse files
Prateek Agarwalthierryreding
authored andcommitted
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 <[email protected]> Fixes: e09db97 ("drm/tegra: Support context isolation") [[email protected]: reword commit message] Signed-off-by: Mikko Perttunen <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 4c5376b commit 6cbab9f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/gpu/drm/tegra/uapi.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,12 @@ int tegra_drm_ioctl_channel_open(struct drm_device *drm, void *data, struct drm_
114114
if (err)
115115
goto put_channel;
116116

117-
if (supported)
117+
if (supported) {
118+
struct pid *pid = get_task_pid(current, PIDTYPE_TGID);
118119
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+
}
120123

121124
if (IS_ERR(context->memory_context)) {
122125
if (PTR_ERR(context->memory_context) != -EOPNOTSUPP) {

0 commit comments

Comments
 (0)