Commit 00ceff91 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

drm/amdkfd: NULL dereference involving create_process()


[ Upstream commit b312b2b2 ]

We accidentally return ERR_PTR(0) which is NULL.  The caller is not
expecting that and it leads to an Oops.

Fixes: dd59239a ("amdkfd: init aperture once per process")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarFelix Kuehling <felix.kuehling@amd.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bc12167c
......@@ -317,7 +317,8 @@ static struct kfd_process *create_process(const struct task_struct *thread)
/* init process apertures*/
process->is_32bit_user_mode = in_compat_syscall();
if (kfd_init_apertures(process) != 0)
err = kfd_init_apertures(process);
if (err != 0)
goto err_init_apretures;
return process;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment