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: <20201127111549.7d5d50ed@kicinski-fedora-pc1c0hjn.DHCP.thefacebook.com>
Date:   Fri, 27 Nov 2020 11:15:49 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Marc Kleine-Budde <mkl@...gutronix.de>
Cc:     netdev@...r.kernel.org, davem@...emloft.net,
        linux-can@...r.kernel.org, kernel@...gutronix.de,
        Niels Petter <petter@...long.de>
Subject: Re: [net 2/6] can: mcp251xfd: mcp251xfd_probe(): bail out if no IRQ
 was given

On Fri, 27 Nov 2020 11:02:57 +0100 Marc Kleine-Budde wrote:
> This patch add a check to the mcp251xfd_probe() function to bail out and give
> the user a proper error message if no IRQ is specified. Otherwise the driver
> will probe just fine but ifup will fail with a meaningless "RTNETLINK answers:
> Invalid argument" error message.
> 
> Link: https://lore.kernel.org/r/20201123113522.3820052-1-mkl@pengutronix.de
> Reported-by: Niels Petter <petter@...long.de>
> Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
> ---
>  drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
> index 9c215f7c5f81..8a39be076e14 100644
> --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
> +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
> @@ -2738,6 +2738,10 @@ static int mcp251xfd_probe(struct spi_device *spi)
>  	u32 freq;
>  	int err;
>  
> +	if (!spi->irq)
> +		return dev_err_probe(&spi->dev, -ENXIO,
> +				     "No IRQ specified (maybe node \"interrupts-extended\" 

FWIW this looks like an abuse of dev_err_probe() to me. What's the point
of calling it with a constant err which is not EPROBE_DEFER?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ