From: Dan Carpenter Date: Fri, 7 Mar 2025 09:30:16 +0000 (+0300) Subject: media: synopsys: hdmirx: Fix signedness bug in hdmirx_parse_dt() X-Git-Tag: v6.15-rc1~174^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca8dc5951b6be04bb6e2b69a1606c8fbaa5e4fb4;p=thirdparty%2Fkernel%2Flinux.git media: synopsys: hdmirx: Fix signedness bug in hdmirx_parse_dt() The num_clks is set this way: hdmirx_dev->num_clks = devm_clk_bulk_get_all(dev, &hdmirx_dev->clks); if (hdmirx_dev->num_clks < 1) return -ENODEV; The devm_clk_bulk_get_all() function returns negative error codes so the hdmirx_dev->num_cks variable needs to be signed for the error handling to work. Fixes: 7b59b132ad43 ("media: platform: synopsys: Add support for HDMI input driver") Signed-off-by: Dan Carpenter Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil --- diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c index e4cdd8b5745de..3d2913de9a86c 100644 --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c @@ -151,7 +151,7 @@ struct snps_hdmirx_dev { bool hpd_trigger_level_high; bool tmds_clk_ratio; bool plugged; - u32 num_clks; + int num_clks; u32 edid_blocks_written; u32 cur_fmt_fourcc; u32 color_depth;