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: <cdc59a04-20cb-0462-830b-2f16e69d3125@microchip.com>
Date:   Tue, 14 Jun 2022 07:34:12 +0000
From:   <Conor.Dooley@...rochip.com>
To:     <broonie@...nel.org>
CC:     <Daire.McNamara@...rochip.com>, <Lewis.Hanly@...rochip.com>,
        <linux-riscv@...ts.infradead.org>, <linux-spi@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <yang.lee@...ux.alibaba.com>
Subject: Re: [PATCH] spi: microchip-core: fix potentially incorrect return
 from probe

On 14/06/2022 07:58, Conor Dooley wrote:
> If platform_get_irqi() returns 0, the error case will be triggered but
> probe() will return 0 rather than an error. Ape the other drivers using
> this pattern and return -ENXIO.
> 
> Reported-by: Yang Li <yang.lee@...ux.alibaba.com>
> Link: https://lore.kernel.org/linux-spi/20220609055533.95866-2-yang.lee@linux.alibaba.com/

Woops, forgot this one:
Fixes: 9ac8d17694b6 ("spi: add support for microchip fpga spi controllers")

> Signed-off-by: Conor Dooley <conor.dooley@...rochip.com>
> ---
>   drivers/spi/spi-microchip-core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
> index 5b22a1395554..856a68fd8e9f 100644
> --- a/drivers/spi/spi-microchip-core.c
> +++ b/drivers/spi/spi-microchip-core.c
> @@ -541,7 +541,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
>   	spi->irq = platform_get_irq(pdev, 0);
>   	if (spi->irq <= 0) {
>   		dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq);
> -		ret = spi->irq;
> +		ret = -ENXIO;
>   		goto error_release_master;
>   	}
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ