lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <adfcf465-cff1-e15e-89fa-fdc573b7820f@gmail.com>
Date:   Fri, 28 Jan 2022 19:37:41 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Miaoqian Lin <linmq006@...il.com>,
        Laxman Dewangan <ldewangan@...dia.com>,
        Mark Brown <broonie@...nel.org>,
        Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        linux-spi@...r.kernel.org, linux-tegra@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] spi: tegra20: Fix missing IRQ check in
 tegra_slink_probe

28.01.2022 19:18, Miaoqian Lin пишет:
> This func misses checking for platform_get_irq()'s call and may passes the
> negative error codes to request_threaded_irq(), which takes unsigned IRQ #,
> causing it to fail with -EINVAL, overriding an original error code.
> Stop calling request_threaded_irq() with invalid IRQ #s.
> 
> Fixes: e4bb903fda0e ("spi: tegra20-slink: Improve runtime PM usage")

I don't see how this patch is related to e4bb903fda0e. This tag is
incorrect and should be removed.

> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
> ---
> Changes in v2:
> - fix wrong func name in commit message.
> ---
>  drivers/spi/spi-tegra20-slink.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
> index 2a03739a0c60..0eea35882777 100644
> --- a/drivers/spi/spi-tegra20-slink.c
> +++ b/drivers/spi/spi-tegra20-slink.c
> @@ -1100,6 +1100,11 @@ static int tegra_slink_probe(struct platform_device *pdev)
>  	reset_control_deassert(tspi->rst);
>  
>  	spi_irq = platform_get_irq(pdev, 0);
> +	if (spi_irq < 0) {
> +		dev_err(&pdev->dev, "Unable to request IRQ: %d\n", ret);

The "ret" isn't assigned to spi_irq in the error message.

Moreover, platform_get_irq() already prints error message [1] by itself.
The duplicated message is unnecessary and should be removed.

[1]
https://elixir.bootlin.com/linux/v5.17-rc1/source/drivers/base/platform.c#L256

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ