From: Thomas Zimmermann <tzimmermann@suse.de>
To: Bart Van Assche <bvanassche@acm.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: "Maxime Ripard" <mripard@kernel.org>,
linux-kernel@vger.kernel.org,
"Christian König" <christian.koenig@amd.com>,
"Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>,
"Javier Martinez Canillas" <javierm@redhat.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Nathan Chancellor" <nathan@kernel.org>
Subject: Re: [PATCH] drm/fb-helper: Fix a locking bug in an error path
Date: Tue, 7 Apr 2026 09:44:30 +0200 [thread overview]
Message-ID: <1c03e4d8-0eac-4863-a18d-1ea750c853fb@suse.de> (raw)
In-Reply-To: <20260403205355.1181984-1-bvanassche@acm.org>
Hi
Am 03.04.26 um 22:53 schrieb Bart Van Assche:
> 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>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks a lot.
Best regards
Thomas
> ---
> drivers/gpu/drm/drm_fb_helper.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 05803169bed5..16bfbfb0af16 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -1641,8 +1641,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) {
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
next prev parent reply other threads:[~2026-04-07 7:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-03 20:53 Bart Van Assche
2026-04-07 7:44 ` Thomas Zimmermann [this message]
2026-04-07 7:47 ` Thomas Zimmermann
2026-04-07 15:17 ` Bart Van Assche
2026-04-07 15:27 ` Thomas Zimmermann
2026-04-09 10:10 ` Javier Martinez Canillas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1c03e4d8-0eac-4863-a18d-1ea750c853fb@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=bvanassche@acm.org \
--cc=christian.koenig@amd.com \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=javierm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nathan@kernel.org \
--cc=simona@ffwll.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®