Thread (3 messages) 3 messages, 3 authors, 2026-03-26

Re: [PATCH RESEND] drm/rockchip: cdn-dp: add missing check in cdn_dp_config_video()

From: Chaoyi Chen <hidden>
Date: 2026-01-31 09:01:53
Also in: dri-devel, linux-rockchip, stable

On 1/31/2026 4:35 AM, Sergey Shtylyov wrote:
quoted hunk ↗ jump to hunk
The result of cdn_dp_reg_write() is checked everywhere (with the error
being logged by the callers) except one place in cdn_dp_config_video().
Add the missing result check, bailing out early on error...

Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.

Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")
Signed-off-by: Sergey Shtylyov <redacted>
Cc: stable@vger.kernel.org
---
Either we need to add the check or drop the assignment to the ret variable
as the value gets ignored anyway...

The patch is against the drm-misc-fixes branch of the DRM kernel.git repo
on gitlab.freedesktop.org.

 drivers/gpu/drm/rockchip/cdn-dp-reg.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/rockchip/cdn-dp-reg.c b/drivers/gpu/drm/rockchip/cdn-dp-reg.c
index 0dc3804051a9..9b82b27770e5 100644
--- a/drivers/gpu/drm/rockchip/cdn-dp-reg.c
+++ b/drivers/gpu/drm/rockchip/cdn-dp-reg.c
@@ -685,6 +685,8 @@ int cdn_dp_config_video(struct cdn_dp_device *dp)
 	val = div_u64(8 * (symbol + 1), bit_per_pix) - val;
 	val += 2;
 	ret = cdn_dp_reg_write(dp, DP_VC_TABLE(15), val);
+	if (ret)
+		goto err_config_video;
 
 	switch (video->color_depth) {
 	case 6:
Not sure why this was resent, but it looks good to me :)

Reviewed-by: Chaoyi Chen <redacted>

-- 
Best, 
Chaoyi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help