Skip to content

Commit fd204cf

Browse files
bvanasschegregkh
authored andcommitted
drm/fb-helper: Fix a locking bug in an error path
[ Upstream commit bd64240 ] The name of the function __drm_fb_helper_initial_config_and_unlock() and also the comment above that function make it clear that all code paths in this function should unlock fb_helper->lock before returning. Add a mutex_unlock() call in the only code path where it is missing. This has been detected by the Clang thread-safety analyzer. Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Christian König <christian.koenig@amd.com> # radeon Cc: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> # msm Cc: Javier Martinez Canillas <javierm@redhat.com> Fixes: 63c971a ("drm/fb-helper: Allocate and release fb_info in single place") Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patch.msgid.link/20260403205355.1181984-1-bvanassche@acm.org Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ce899f9 commit fd204cf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1641,8 +1641,10 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper)
16411641
drm_client_modeset_probe(&fb_helper->client, width, height);
16421642

16431643
info = drm_fb_helper_alloc_info(fb_helper);
1644-
if (IS_ERR(info))
1644+
if (IS_ERR(info)) {
1645+
mutex_unlock(&fb_helper->lock);
16451646
return PTR_ERR(info);
1647+
}
16461648

16471649
ret = drm_fb_helper_single_fb_probe(fb_helper);
16481650
if (ret < 0) {

0 commit comments

Comments
 (0)