Commit 0a260e73 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Daniel Vetter

drm/fb-helper: Add missed unlocks in setcmap_legacy()

setcmap_legacy() does not call drm_modeset_unlock_all() in some exits,
add the missed unlocks with goto to fix it.

Fixes: 964c6006 ("drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths")
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20201203144248.418281-1-hslester96@gmail.com
parent 15ccc39b
...@@ -946,11 +946,15 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) ...@@ -946,11 +946,15 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info)
drm_modeset_lock_all(fb_helper->dev); drm_modeset_lock_all(fb_helper->dev);
drm_client_for_each_modeset(modeset, &fb_helper->client) { drm_client_for_each_modeset(modeset, &fb_helper->client) {
crtc = modeset->crtc; crtc = modeset->crtc;
if (!crtc->funcs->gamma_set || !crtc->gamma_size) if (!crtc->funcs->gamma_set || !crtc->gamma_size) {
return -EINVAL; ret = -EINVAL;
goto out;
}
if (cmap->start + cmap->len > crtc->gamma_size) if (cmap->start + cmap->len > crtc->gamma_size) {
return -EINVAL; ret = -EINVAL;
goto out;
}
r = crtc->gamma_store; r = crtc->gamma_store;
g = r + crtc->gamma_size; g = r + crtc->gamma_size;
...@@ -963,8 +967,9 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) ...@@ -963,8 +967,9 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info)
ret = crtc->funcs->gamma_set(crtc, r, g, b, ret = crtc->funcs->gamma_set(crtc, r, g, b,
crtc->gamma_size, NULL); crtc->gamma_size, NULL);
if (ret) if (ret)
return ret; goto out;
} }
out:
drm_modeset_unlock_all(fb_helper->dev); drm_modeset_unlock_all(fb_helper->dev);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment