Skip to contentSkip to conversation

staging: vboxvideo: unlock on error in vbox_cursor_atomic_update()

PATCH In review Dan Carpenter 2 participants 2 messages Oct 11, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: vboxvideo: unlock on error in vbox_cursor_atomic_update()

We need to unlock before returning on this error path.

Fixes 35f3288c453e ("staging: vboxvideo: Atomic phase 1: convert cursor to universal plane")
drivers/staging/vboxvideo/vbox_mode.c +1 -0
index 042e4f384df9..78a9c9b13ff6 100644
@@ -424,6 +424,7 @@ static void vbox_cursor_atomic_update(struct drm_plane *plane,
 	/* pinning is done in prepare/cleanup framebuffer */
 	src = vbox_bo_kmap(bo);
 	if (IS_ERR(src)) {
+		mutex_unlock(&vbox->hw_mutex);
 		DRM_WARN("Could not kmap cursor bo, skipping update\n");
 		return;
 	}
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 4 lines · Dan Carpenter

We need to unlock before returning on this error path.

Fixes 35f3288c453e ("staging: vboxvideo: Atomic phase 1: convert cursor to universal plane")

Thanks, the kbuild test robot had already notified me about this but I did not get around to fixing it yet.

Fix looks good to me:

Regards,

Hans

Quoted 14 lines
drivers/staging/vboxvideo/vbox_mode.c +1 -0
index 042e4f384df9..78a9c9b13ff6 100644
@@ -424,6 +424,7 @@ static void vbox_cursor_atomic_update(struct drm_plane *plane,
  	/* pinning is done in prepare/cleanup framebuffer */
  	src = vbox_bo_kmap(bo);
  	if (IS_ERR(src)) {
+		mutex_unlock(&vbox->hw_mutex);
  		DRM_WARN("Could not kmap cursor bo, skipping update\n");
  		return;
  	}