summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2015-10-12 01:49:39 -0700
committerThomas Hellstrom <thellstrom@vmware.com>2015-10-13 00:16:48 -0700
commited7d78b2da32198ca4c70172e3b63c6b3e2c570b (patch)
tree41178e69ad96f4c93605e3cdff381091f0b9937e
parent575f9c8604e0b4c7b36fb41fc5fd280a3c336906 (diff)
downloadop-kernel-dev-ed7d78b2da32198ca4c70172e3b63c6b3e2c570b.zip
op-kernel-dev-ed7d78b2da32198ca4c70172e3b63c6b3e2c570b.tar.gz
drm/vmwgfx: Fix kernel NULL pointer dereference on older hardware
The commit "drm/vmwgfx: Fix up user_dmabuf refcounting", while fixing a kernel crash introduced a NULL pointer dereference on older hardware. Fix this. Cc: <stable@vger.kernel.org> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_surface.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
index 64b5040..03f63c7 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -657,7 +657,8 @@ static void vmw_user_surface_base_release(struct ttm_base_object **p_base)
struct vmw_resource *res = &user_srf->srf.res;
*p_base = NULL;
- ttm_base_object_unref(&user_srf->backup_base);
+ if (user_srf->backup_base)
+ ttm_base_object_unref(&user_srf->backup_base);
vmw_resource_unreference(&res);
}
OpenPOWER on IntegriCloud