drm/amdkfd: Add crash protection in debugger register path
authorPhilip Yang <Philip.Yang@amd.com>
Mon, 27 Nov 2017 23:29:44 +0000 (18:29 -0500)
committerOded Gabbay <oded.gabbay@gmail.com>
Mon, 27 Nov 2017 23:29:44 +0000 (18:29 -0500)
commit3c0b42809071cb6d779b9c4a573edd5d12654f43
tree564999afa490002154f1bf5e3405be9cff679c83
parenta9efcc19161e20623c285fac967a32842972cebe
drm/amdkfd: Add crash protection in debugger register path

After debugger is registered, the pqm_destroy_queue fails because is_debug
is true, the queue should not be removed from process_queue_list since
the count is not reduced.

Test application calls debugger unregister without register debugger, add
null pointer check protection to avoid crash for this case

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c