]> Git Repo - linux.git/commitdiff
drm/vmwgfx: Fix kernel NULL pointer dereference on older hardware
authorThomas Hellstrom <[email protected]>
Mon, 12 Oct 2015 08:49:39 +0000 (01:49 -0700)
committerThomas Hellstrom <[email protected]>
Tue, 13 Oct 2015 07:16:48 +0000 (00:16 -0700)
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: <[email protected]>
Signed-off-by: Thomas Hellstrom <[email protected]>
Reviewed-by: Sinclair Yeh <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c

index 64b50409fa0749558844cf561aac983e36197241..03f63c749c02333f412c82184f20def8ce1d8d74 100644 (file)
@@ -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);
 }
 
This page took 0.056893 seconds and 4 git commands to generate.