Commit bd64240d authored by Bart Van Assche's avatar Bart Van Assche Committed by Thomas Zimmermann
Browse files

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: 63c971af ("drm/fb-helper: Allocate and release fb_info in single place")
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260403205355.1181984-1-bvanassche@acm.org
parent 408df621
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1626,8 +1626,10 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper)
	drm_client_modeset_probe(&fb_helper->client, width, height);

	info = drm_fb_helper_alloc_info(fb_helper);
	if (IS_ERR(info))
	if (IS_ERR(info)) {
		mutex_unlock(&fb_helper->lock);
		return PTR_ERR(info);
	}

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