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: <20240822102609.GK2164@kernel.org>
Date: Thu, 22 Aug 2024 11:26:09 +0100
From: Simon Horman <horms@...nel.org>
To: Marek Vasut <marex@...x.de>
Cc: linux-wireless@...r.kernel.org, Ajay Singh <ajay.kathat@...rochip.com>,
	"David S. Miller" <davem@...emloft.net>,
	Adham Abozaeid <adham.abozaeid@...rochip.com>,
	Alexis Lothoré <alexis.lothore@...tlin.com>,
	Claudiu Beznea <claudiu.beznea@...on.dev>,
	Conor Dooley <conor+dt@...nel.org>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Kalle Valo <kvalo@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>, Rob Herring <robh@...nel.org>,
	devicetree@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH 2/2] wifi: wilc1000: Add WILC3000 support

On Wed, Aug 21, 2024 at 08:42:33PM +0200, Marek Vasut wrote:
> From: Ajay Singh <ajay.kathat@...rochip.com>
> 
> Add support for the WILC3000 chip. The chip is similar to WILC1000,
> except that the register layout is slightly different and it does
> not support WPA3/SAE.
> 
> Signed-off-by: Ajay Singh <ajay.kathat@...rochip.com>
> Signed-off-by: Marek Vasut <marex@...x.de>

...

> diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c
> index 41122199d51eb..7b99fcc450fd3 100644
> --- a/drivers/net/wireless/microchip/wilc1000/sdio.c
> +++ b/drivers/net/wireless/microchip/wilc1000/sdio.c
> @@ -764,9 +764,13 @@ static int wilc_sdio_init(struct wilc *wilc, bool resume)
>  	 *      make sure can read back chip id correctly
>  	 **/
>  	if (!resume) {
> -		ret = wilc_sdio_read_reg(wilc, WILC_CHIPID, &chipid);
> -		if (ret) {
> -			dev_err(&func->dev, "Fail cmd read chip id...\n");
> +		chipid = wilc_get_chipid(wilc, true);
> +		if (is_wilc3000(chipid)) {
> +			wilc->chip = WILC_3000;
> +		} else if (is_wilc1000(chipid)) {
> +			wilc->chip = WILC_1000;
> +		} else {
> +			dev_err(&func->dev, "Unsupported chipid: %x\n", chipid);
>  			return ret;

Hi Marek and Ajay,

It seems that with this change ret will be 0 here.
Perhaps an negative error code should be returned instead?

Flagged by Smatch.

>  		}
>  		dev_err(&func->dev, "chipid (%08x)\n", chipid);

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ