lkml.org 
[lkml]   [2019]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Potential NULL pointer deference in drm/amdgpu
Date
Hi Yizhuo,

Am 10.10.19 um 07:09 schrieb Yizhuo Zhai:
> Hi All:
> drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:
> The function to_amdgpu_fence() could return NULL, but callers
> in this file does not check the return value but directly dereference it,
> which seems potentially unsafe.
> Such callers include amdgpu_fence_get_timeline_name(),
> amdgpu_fence_enable_signaling() and amdgpu_fence_free().

That is expected behavior and no need to worry.

The functions in amdgpu_fence.c are the callbacks to implement
amdgpu_fence_ops. The function to_amdgpu_fence() checks if the ops of
the fence are amdgpu_fence_ops, so it is guaranteed that the functions
are called with an amdgpu_fence structure.

Regards,
Christian.
\
 
 \ /
  Last update: 2019-10-10 08:53    [W:4.535 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site