drm/i915/gem: Prevent NULL pointer dereference on missing ctx->vm
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 23 Jan 2020 15:26:02 +0000 (15:26 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 24 Jan 2020 10:22:08 +0000 (10:22 +0000)
commit90211ea4ba6e8066f827434e67678cb80f51ba58
treec145acf3d700a013a07202a5bdae2a44d8797995
parent423177140e9fcbd2ee5fef3845d4623f4ec31ed8
drm/i915/gem: Prevent NULL pointer dereference on missing ctx->vm

If the ctx->vm is freed before we can acquire a local reference to it,
we proceed to call i915_vm_put(NULL), which is invalid.

Reported-by: Colin Ian King <colin.king@canonical.com>
Fixes: 5dbd2b7be61e ("drm/i915/gem: Convert vm idr to xarray")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200123152602.1432282-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_context.c