[Intel-gfx] Potential NULL pointer dereference in intel_crt_get_edid

Shaobo He shaobo at cs.utah.edu
Mon Mar 18 23:01:10 UTC 2019


Hello everyone,

My name is Shaobo He and I am a graduate student at University of Utah. I am 
using a static analysis tool to search for null pointer dereferences and came 
across a potentially invalid memory access in the file 
drivers/gpu/drm/i915/intel_crt.c: in function `intel_crt_detect_ddc`, function 
`intel_gmbus_get_adapter` can return a NULL pointer which is dereferenced by the 
call to `drm_get_edid` or `intel_gmbus_is_forced_bit`. It seems that the return 
value of `intel_gmbus_get_adapter` is never NULL-checked. If so, it would be 
better to replace the branch to return a NULL pointer with something like `BUG_ON`.

Please let me know if it makes sense. I am looking forward to your reply.

Best,
Shaobo


More information about the Intel-gfx mailing list