[PATCH] drm: avoid passing null pointer to memset

Chris Wilson chris at chris-wilson.co.uk
Tue Oct 9 11:03:13 PDT 2012

On Tue,  9 Oct 2012 14:50:46 -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.
usize should be 0 in that case, since the ioctl is neither copying data
in or out, for example I915_GEM_THROTTLE. To be on the safe side:
if (IOC_IN | IOC_OUT) { /* blah */ } else usize = 0;

Chris Wilson, Intel Open Source Technology Centre

More information about the dri-devel mailing list