[PATCH] drm/mm: avoid possible null pointer dereference

Chris Wilson chris at chris-wilson.co.uk
Mon May 23 15:50:48 UTC 2016


On Mon, May 23, 2016 at 04:35:53PM +0100, Eric Engestrom wrote:
> On Mon, May 23, 2016 at 02:46:59PM +0100, Chris Wilson wrote:
> > It's a programming error, just as would be passing in mm == NULL. Mark up
> > the function as requiring non-NULL parameters.
> 
> Using `__attribute__((nonnull))`? I approve of that idea, as I find
> those attributes extremely useful and try to get them used as much as
> possible at $DAYJOB.
> 
> I have noticed however that this particular attribute isn't used much in
> the kernel (4 times that I could find with a simple grep), to the point
> of not even having a `__nonnull`. Any reason you know of?

Not that I know of. Even more confusing is its use under tools but not
being added to the main kernel.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list