]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Sanity check DP AUX message buffer and size
authorImre Deak <imre.deak@intel.com>
Fri, 29 Jan 2016 12:52:26 +0000 (14:52 +0200)
committerImre Deak <imre.deak@intel.com>
Tue, 2 Feb 2016 16:28:20 +0000 (18:28 +0200)
commite05618add00669ee5d1903dcdb26951a630acea5
tree77fb04360979d9ab1cc132bc369d4c494a64c55c
parent11c20e901e3cb30474a2910ff2b4c20ebad3793f
drm/i915: Sanity check DP AUX message buffer and size

While we are calling intel_dp_aux_transfer() with msg->size=0 whenever
msg->buffer is NULL, passing NULL to memcpy() is undefined according to
the ISO C standard. I haven't found any notes about this in the GNU C's
or the kernel's documentation of the function and can't imagine what it
would do with the NULL ptr. To better document this use of the
parameters it still make sense to add an explicit check for this to the
code.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: David Weinehall <david.weinehall@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1454071949-24677-1-git-send-email-imre.deak@intel.com
drivers/gpu/drm/i915/intel_dp.c