Skip to content

Commit bd64240

Browse files
bvanasschetdz
authored andcommitted
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 <[email protected]> Cc: Christian König <[email protected]> # radeon Cc: Dmitry Baryshkov <[email protected]> # msm Cc: Javier Martinez Canillas <[email protected]> Fixes: 63c971a ("drm/fb-helper: Allocate and release fb_info in single place") Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 408df62 commit bd64240

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
@@ -1626,8 +1626,10 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper)
16261626
drm_client_modeset_probe(&fb_helper->client, width, height);
16271627

16281628
info = drm_fb_helper_alloc_info(fb_helper);
1629-
if (IS_ERR(info))
1629+
if (IS_ERR(info)) {
1630+
mutex_unlock(&fb_helper->lock);
16301631
return PTR_ERR(info);
1632+
}
16311633

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

0 commit comments

Comments
 (0)