drm/fb-helper: Add missed unlocks in setcmap_legacy()
Subsystems (2)
PATCH 1/1 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.
--- drivers/gpu/drm/drm_fb_helper.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +10 -5
@@ -923,11 +923,15 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info)drm_modeset_lock_all (fb_helper->dev);drm_client_for_each_modeset (modeset, &fb_helper->client) { crtc = modeset->crtc; -if (!crtc->funcs->gamma_set || !crtc->gamma_size) -return -EINVAL ; +if (!crtc->funcs->gamma_set || !crtc->gamma_size) { + ret = -EINVAL ; + goto out; + } -if (cmap->start + cmap->len > crtc->gamma_size) -return -EINVAL ; +if (cmap->start + cmap->len > crtc->gamma_size) { + ret = -EINVAL ; + goto out; + } r = crtc->gamma_store; g = r + crtc->gamma_size;
@@ -940,8 +944,9 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) ret = crtc->funcs->gamma_set (crtc, r, g, b, crtc->gamma_size,NULL );if (ret) -return ret; + goto out; } +out:drm_modeset_unlock_all (fb_helper->dev);return ret;
Signature · 1 line
2.26.2
Hi!
Quoted 5 lines · Chuhong Yuan
setcmap_legacy()does not calldrm_modeset_unlock_all()in some exits, add the missed unlocks with goto to fix it.Fixes 964c60063bff ("drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths")Signed-off-by Chuhong Yuan <[email protected]>
Yup, my patch fumbled the locking. Sorry, and thanks for cleaning up my mess!
(Spelled that as Ached-by at first, what does that mean??)
Cheers,
Peter
Quoted 40 lines
--- drivers/gpu/drm/drm_fb_helper.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)drivers/gpu/drm/drm_fb_helper.c +10
-5@@ -923,11 +923,15 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info)drm_modeset_lock_all (fb_helper->dev);drm_client_for_each_modeset (modeset, &fb_helper->client) { crtc = modeset->crtc; -if (!crtc->funcs->gamma_set || !crtc->gamma_size) -return -EINVAL ; +if (!crtc->funcs->gamma_set || !crtc->gamma_size) { + ret = -EINVAL ; + goto out; + } -if (cmap->start + cmap->len > crtc->gamma_size) -return -EINVAL ; +if (cmap->start + cmap->len > crtc->gamma_size) { + ret = -EINVAL ; + goto out; + } r = crtc->gamma_store; g = r + crtc->gamma_size;@@ -940,8 +944,9 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) ret = crtc->funcs->gamma_set (crtc, r, g, b, crtc->gamma_size,NULL );if (ret) -return ret; + goto out; } +out:drm_modeset_unlock_all (fb_helper->dev);return ret;
Quoted 7 lines · Peter Rosin
Hi!
Quoted 3 lines · Chuhong Yuan
setcmap_legacy()does not calldrm_modeset_unlock_all()in some exits, add the missed unlocks with goto to fix it.
Quoted 8 lines
Quoted 2 lines
Fixes 964c60063bff ("drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths")Signed-off-by Chuhong Yuan <[email protected]>Yup, my patch fumbled the locking. Sorry, and thanks for cleaning up my mess!
Acked-by Peter Rosin <[email protected]>(Spelled that as Ached-by at first, what does that mean??)
Merged already before I've seen your ack here (and we don't rebase so can't add it now), thanks for the patch and all.
-Daniel
Quoted 44 lines
Cheers,
PeterQuoted 40 lines
--- drivers/gpu/drm/drm_fb_helper.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)drivers/gpu/drm/drm_fb_helper.c +10
-5@@ -923,11 +923,15 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info)drm_modeset_lock_all (fb_helper->dev);drm_client_for_each_modeset (modeset, &fb_helper->client) { crtc = modeset->crtc; -if (!crtc->funcs->gamma_set || !crtc->gamma_size) -return -EINVAL ; +if (!crtc->funcs->gamma_set || !crtc->gamma_size) { + ret = -EINVAL ; + goto out; + } -if (cmap->start + cmap->len > crtc->gamma_size) -return -EINVAL ; +if (cmap->start + cmap->len > crtc->gamma_size) { + ret = -EINVAL ; + goto out; + } r = crtc->gamma_store; g = r + crtc->gamma_size;@@ -940,8 +944,9 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) ret = crtc->funcs->gamma_set (crtc, r, g, b, crtc->gamma_size,NULL );if (ret) -return ret; + goto out; } +out:drm_modeset_unlock_all (fb_helper->dev);return ret;
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel