drm/amdkfd: Fix NULL pointer dereference in svm_migrate_to_ram()
Subsystems (3)
PATCH 1/1 drm/amdkfd: Fix NULL pointer dereference in svm_migrate_to_ram()
./drivers/gpu/drm/amd/amdkfd/kfd_migrate.c:985:58-62: ERROR: p is NULL but dereferenced.
Reported-by Abaci Robot <[email protected]>
Signed-off-by Yang Li <[email protected]>
---
change in v2:
According to Felix's suggestion, move the pr_debug up before the kfd_unref_process call.
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +1 -3
@@ -978,12 +978,10 @@ static vm_fault_t svm_migrate_to_ram(struct vm_fault *vmf) out_unlock_svms:mutex_unlock (&p->svms.lock); out_unref_process: +pr_debug ("CPU fault svms 0x%p address 0x%lx done\n" , &p->svms, addr);kfd_unref_process (p); out_mmput:mmput (mm); - -pr_debug ("CPU fault svms 0x%p address 0x%lx done\n" , &p->svms, addr); -return r ?VM_FAULT_SIGBUS :0 ; }
Signature · 1 line
2.20.1.7.g153144c
Quoted 5 lines · Yang Li
./drivers/gpu/drm/amd/amdkfd/kfd_migrate.c:985:58-62: ERROR: p is NULL but dereferenced.
Reported-by Abaci Robot <[email protected]>Signed-off-by Yang Li <[email protected]>
The patch is
Reviewed-by Felix Kuehling <[email protected]>
I applied to our amd-staging-drm-next branch.
Thanks,
Felix
Quoted 27 lines
---
change in v2:
According to Felix's suggestion, move thepr_debugup before thekfd_unref_processcall.drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +1
-3@@ -978,12 +978,10 @@ static vm_fault_t svm_migrate_to_ram(struct vm_fault *vmf) out_unlock_svms:mutex_unlock (&p->svms.lock); out_unref_process: +pr_debug ("CPU fault svms 0x%p address 0x%lx done\n" , &p->svms, addr);kfd_unref_process (p); out_mmput:mmput (mm); - -pr_debug ("CPU fault svms 0x%p address 0x%lx done\n" , &p->svms, addr); -return r ?VM_FAULT_SIGBUS :0 ; }