]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/rockchip: cdn-dp: add missing check in cdn_dp_config_video()
authorSergey Shtylyov <s.shtylyov@auroraos.dev>
Fri, 30 Jan 2026 20:35:42 +0000 (23:35 +0300)
committerHeiko Stuebner <heiko@sntech.de>
Thu, 26 Mar 2026 19:37:02 +0000 (20:37 +0100)
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 <s.shtylyov@auroraos.dev>
Cc: stable@vger.kernel.org
Reviewed-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/adf6b313-f7db-4d8f-9000-8c65446ba041@auroraos.dev
drivers/gpu/drm/rockchip/cdn-dp-reg.c

index 0dc3804051a9448e7e176b6f5d42c2d3b352e967..9b82b27770e5cf79a24bd9f967403a4076369110 100644 (file)
@@ -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: