[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54d5eef8-66a9-44aa-9e9b-0324d6fee46d@collabora.com>
Date: Fri, 7 Mar 2025 12:36:47 +0300
From: Dmitry Osipenko <dmitry.osipenko@...labora.com>
To: Dan Carpenter <dan.carpenter@...aro.org>,
Shreeya Patel <shreeya.patel@...labora.com>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
Hans Verkuil <hverkuil@...all.nl>, Dingxian Wen <shawn.wen@...k-chips.com>,
linux-media@...r.kernel.org, kernel@...labora.com,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH next] media: synopsys: hdmirx: Fix signedness bug in
hdmirx_parse_dt()
On 3/7/25 12:30, Dan Carpenter wrote:
> 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 <dan.carpenter@...aro.org>
> ---
> drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> index 4ffc86ad6c35..e0d3fed87a92 100644
> --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> @@ -154,7 +154,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;
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@...labora.com>
Would be also good to return the original error code. There is no need
to check for the < 1 clock, it should be the < 0 check. Can be done in a
separate patch later. Thanks for the fix!
--
Best regards,
Dmitry
Powered by blists - more mailing lists