* [PATCH] drm/bridge: cdns-mhdp8546: unlock on error in cdns_mhdp_atomic_enable()
@ 2025-04-30 8:02 Dan Carpenter
2025-05-03 4:34 ` Dmitry Baryshkov
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-04-30 8:02 UTC (permalink / raw)
To: Andrzej Hajda
Cc: Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Dmitry Baryshkov,
Douglas Anderson, Lyude Paul, Andy Yan, Al Viro, Vitalii Mordan,
Sui Jingfeng, dri-devel, linux-kernel, kernel-janitors
Unlock and reschedule if drm_mode_duplicate() fails. In real life, the
drm_mode_duplicate() function does a small allocation and those never
fail in current kernels. So this doesn't really affect runtime but
the missing unlock triggers a static checker warning.
Fixes: 935a92a1c400 ("drm: bridge: cdns-mhdp8546: Fix possible null pointer dereference")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
index b431e7efd1f0..172039fbfab8 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
@@ -1984,8 +1984,10 @@ static void cdns_mhdp_atomic_enable(struct drm_bridge *bridge,
mhdp_state = to_cdns_mhdp_bridge_state(new_state);
mhdp_state->current_mode = drm_mode_duplicate(bridge->dev, mode);
- if (!mhdp_state->current_mode)
- return;
+ if (!mhdp_state->current_mode) {
+ ret = -ENOMEM;
+ goto out;
+ }
drm_mode_set_name(mhdp_state->current_mode);
--
2.47.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] drm/bridge: cdns-mhdp8546: unlock on error in cdns_mhdp_atomic_enable()
2025-04-30 8:02 [PATCH] drm/bridge: cdns-mhdp8546: unlock on error in cdns_mhdp_atomic_enable() Dan Carpenter
@ 2025-05-03 4:34 ` Dmitry Baryshkov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Baryshkov @ 2025-05-03 4:34 UTC (permalink / raw)
To: Dan Carpenter
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Dmitry Baryshkov,
Douglas Anderson, Lyude Paul, Andy Yan, Al Viro, Vitalii Mordan,
Sui Jingfeng, dri-devel, linux-kernel, kernel-janitors
On Wed, Apr 30, 2025 at 11:02:14AM +0300, Dan Carpenter wrote:
> Unlock and reschedule if drm_mode_duplicate() fails. In real life, the
> drm_mode_duplicate() function does a small allocation and those never
> fail in current kernels. So this doesn't really affect runtime but
> the missing unlock triggers a static checker warning.
>
> Fixes: 935a92a1c400 ("drm: bridge: cdns-mhdp8546: Fix possible null pointer dereference")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-03 4:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-30 8:02 [PATCH] drm/bridge: cdns-mhdp8546: unlock on error in cdns_mhdp_atomic_enable() Dan Carpenter
2025-05-03 4:34 ` Dmitry Baryshkov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.