diff options
| author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-06-14 06:58:53 -0400 |
|---|---|---|
| committer | Oded Gabbay <oded.gabbay@gmail.com> | 2017-06-14 06:58:53 -0400 |
| commit | b312b2b25b6ac9e2eb03f4ca651b33108752de3a (patch) | |
| tree | 6549aa9e2ff136e9b6dfe4c5d5675c725cc673c6 | |
| parent | 047b8e21e3bfa9faa4ed9a0c337fe0c687710251 (diff) | |
drm/amdkfd: NULL dereference involving create_process()
We accidentally return ERR_PTR(0) which is NULL. The caller is not
expecting that and it leads to an Oops.
Fixes: dd59239a9862 ("amdkfd: init aperture once per process")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
| -rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_process.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index 84d1ffd1eef9..1190d06884ed 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c | |||
| @@ -318,7 +318,8 @@ static struct kfd_process *create_process(const struct task_struct *thread) | |||
| 318 | 318 | ||
| 319 | /* init process apertures*/ | 319 | /* init process apertures*/ |
| 320 | process->is_32bit_user_mode = in_compat_syscall(); | 320 | process->is_32bit_user_mode = in_compat_syscall(); |
| 321 | if (kfd_init_apertures(process) != 0) | 321 | err = kfd_init_apertures(process); |
| 322 | if (err != 0) | ||
| 322 | goto err_init_apretures; | 323 | goto err_init_apretures; |
| 323 | 324 | ||
| 324 | return process; | 325 | return process; |
