[PATCH] drm: avoid passing null pointer to memset

Chris Wilson chris at chris-wilson.co.uk
Wed Oct 10 05:52:35 PDT 2012


On Tue,  9 Oct 2012 16:56:58 -0300, Rodrigo Vivi <rodrigo.vivi at gmail.com> wrote:
> When cmd isn't IOC_IN | IOC_OUT a null "kdata" goes to "memset", which dereferences it.
> 
> v2: simpler version just using usize = 0 instead of allocating useless memory
> 
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at gmail.com>

Presuming that coverity is smart enough not to complain about
memcpy(NULL, src, 0),

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list