[Intel-gfx] [PATCH] drm/i915: fix driver's versions of WARN_ON & WARN_ON_ONCE

Daniel Vetter daniel at ffwll.ch
Wed Aug 26 00:59:56 PDT 2015


On Mon, Aug 17, 2015 at 01:45:01PM -0300, Paulo Zanoni wrote:
> 2015-08-17 13:30 GMT-03:00 Dave Gordon <david.s.gordon at intel.com>:
> > The current versions of these two macros don't work correctly if the
> > argument expression happens to contain a modulo operator (%) -- when
> > stringified, it gets interpreted as a printf formatting character!
> > With a specifically crafted parameter, this could probably cause a
> > kernel OOPS; consider WARN_ON(p%s) or WARN_ON(f %*pEp).
> >
> > Instead, we should use an explicit "%s" format, with the stringified
> > expression as the coresponding literal-string argument.
> 
> I suppose that was inspired by the recent IGT commit :)
> 
> Reviewed-by: Paulo Zanoni <paulo.r.zanoni at intel.com>

Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list