vmwgfx: Unreference surface on cursor error path
authorJakob Bornecrantz <jakob@vmware.com>
Thu, 3 Nov 2011 20:03:06 +0000 (21:03 +0100)
committerDave Airlie <airlied@redhat.com>
Mon, 7 Nov 2011 13:16:14 +0000 (13:16 +0000)
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

index 667437b037f308f254ffbcd56ca27fd341363758..66e92acb3c5b8545b1fd633f0d3e648233592c0d 100644 (file)
@@ -111,6 +111,7 @@ int vmw_du_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv,
                if (!ret) {
                        if (!surface->snooper.image) {
                                DRM_ERROR("surface not suitable for cursor\n");
+                               vmw_surface_unreference(&surface);
                                return -EINVAL;
                        }
                } else {