Re: [PATCH] drm/amdkfd: Fix potential NULL pointer dereferences

2018-01-10 Thread Gustavo A. R. Silva
Hi Felix, Quoting Felix Kuehling : Hi Gustavo, Thanks for catching that. When returning a fault, I think you also need to srcu_read_unlock(&kfd_processes_srcu, idx). However, instead of returning an error, I think I'd prefer to skip PDDs that can't be found with continue statements. That way

Re: [PATCH] drm/amdkfd: Fix potential NULL pointer dereferences

2018-01-10 Thread Felix Kuehling
Yeah, this looks good to me. Regards,   Felix On 2018-01-10 04:58 PM, Gustavo A. R. Silva wrote: > Hi Felix, > > Quoting Felix Kuehling : > >> Hi Gustavo, >> >> Thanks for catching that. When returning a fault, I think you also need >> to srcu_read_unlock(&kfd_processes_srcu, idx). >> >> However

Re: [PATCH] drm/amdkfd: Fix potential NULL pointer dereferences

2018-01-10 Thread Felix Kuehling
Hi Gustavo, Thanks for catching that. When returning a fault, I think you also need to srcu_read_unlock(&kfd_processes_srcu, idx). However, instead of returning an error, I think I'd prefer to skip PDDs that can't be found with continue statements. That way others would still suspend and resume s

[PATCH] drm/amdkfd: Fix potential NULL pointer dereferences

2018-01-10 Thread Gustavo A. R. Silva
In case kfd_get_process_device_data returns null, there are some null pointer dereferences in functions kfd_bind_processes_to_device and kfd_unbind_processes_from_device. Fix this by null checking pdd before dereferencing it. Addresses-Coverity-ID: 1463794 ("Dereference null return value") Addres