mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
drm/amdgpu: clear job on failure in amdgpu_job_alloc(_with_ib)
If memory is freed we need to nullify the pointer or the caller
might call kfree again (eg: amdgpu_cs_parser_fini calls kfree on
all non-null job pointers).
Fixes: db36632ea5 ("drm/amdgpu: clean up and unify hw fence handling")
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
5de8ce0f37
commit
723c1dd362
|
|
@ -224,6 +224,7 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, struct amdgpu_vm *vm,
|
|||
kfree((*job)->hw_fence);
|
||||
err_job:
|
||||
kfree(*job);
|
||||
*job = NULL;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
|
@ -246,6 +247,7 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev,
|
|||
if (entity)
|
||||
drm_sched_job_cleanup(&(*job)->base);
|
||||
kfree(*job);
|
||||
*job = NULL;
|
||||
}
|
||||
|
||||
return r;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user