[PATCH] drm/i915/kvmgt: avoid dereferencing a potentially null info pointer

Chris Wilson chris at chris-wilson.co.uk
Thu Mar 23 12:39:00 UTC 2017


On Thu, Mar 23, 2017 at 12:22:30PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> info is being checked to see if it is a null pointer, however, vpgu is
> dereferencing info before this check, leading to a potential null
> pointer dereference.  If info is null, then the error message being
> printed by macro gvt_vgpu_err and this requires vpgu to exist. We can
> use a null vpgu as the macro has a sanity check to see if vpgu is null,
> so this is OK.

It is never NULL, it gets checked by its only caller.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list