aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSinclair Yeh <syeh@vmware.com>2016-07-07 14:01:30 -0400
committerSinclair Yeh <syeh@vmware.com>2016-07-08 11:30:35 -0400
commit58541f7a6458e17ab417321b284f0090f530aa91 (patch)
tree66552c974889d321d2b0cbd2233c37ff931e7619
parentbeca4cf55323147ca9c8a98de1871be6e4fe8f34 (diff)
drm/vmwgfx: Fix error paths when mapping framebuffer
Rather than returning immediately, make sure to unlock the mutexes first. Signed-off-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com> Reported-by: Emil Velikov <emil.l.velikov@gmail.com> Cc: <stable@vger.kernel.org>
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_fb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
index 66eaa30d0c08..d2d93959b119 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
@@ -589,7 +589,7 @@ static int vmw_fb_set_par(struct fb_info *info)
589 ret = vfb->pin(vfb); 589 ret = vfb->pin(vfb);
590 if (ret) { 590 if (ret) {
591 DRM_ERROR("Could not pin the fbdev framebuffer.\n"); 591 DRM_ERROR("Could not pin the fbdev framebuffer.\n");
592 return ret; 592 goto out_unlock;
593 } 593 }
594 594
595 ret = ttm_bo_kmap(&par->vmw_bo->base, 0, 595 ret = ttm_bo_kmap(&par->vmw_bo->base, 0,
@@ -597,7 +597,7 @@ static int vmw_fb_set_par(struct fb_info *info)
597 if (ret) { 597 if (ret) {
598 vfb->unpin(vfb); 598 vfb->unpin(vfb);
599 DRM_ERROR("Could not map the fbdev framebuffer.\n"); 599 DRM_ERROR("Could not map the fbdev framebuffer.\n");
600 return ret; 600 goto out_unlock;
601 } 601 }
602 602
603 par->bo_ptr = ttm_kmap_obj_virtual(&par->map, &par->bo_iowrite); 603 par->bo_ptr = ttm_kmap_obj_virtual(&par->map, &par->bo_iowrite);