Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/fb-helper: Fix a locking bug in an error path

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: 63c971af4036 ("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

authored by

Bart Van Assche and committed by
Thomas Zimmermann
bd64240d 408df621

+3 -1
+3 -1
drivers/gpu/drm/drm_fb_helper.c
··· 1626 1626 drm_client_modeset_probe(&fb_helper->client, width, height); 1627 1627 1628 1628 info = drm_fb_helper_alloc_info(fb_helper); 1629 - if (IS_ERR(info)) 1629 + if (IS_ERR(info)) { 1630 + mutex_unlock(&fb_helper->lock); 1630 1631 return PTR_ERR(info); 1632 + } 1631 1633 1632 1634 ret = drm_fb_helper_single_fb_probe(fb_helper); 1633 1635 if (ret < 0) {