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] [day] [month] [year] [list]
Message-ID: <2d11fffd-efa5-9922-fd89-9e7246195f66@wanadoo.fr>
Date:   Sun, 30 Apr 2023 19:26:09 +0200
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     Frank Li <Frank.Li@....com>
Cc:     andriy.shevchenko@...ux.intel.com, heikki.krogerus@...ux.intel.com,
        imx@...ts.linux.dev, jdelvare@...e.de, jic23@...nel.org,
        lars@...afoo.de, linux-iio@...r.kernel.org,
        linux-kernel@...r.kernel.org, petrm@...dia.com, pn@...x.de,
        u.kleine-koenig@...gutronix.de
Subject: Re: [PATCH 1/1] iio: light: vcnl4035: fixed chip ID check

Le 27/04/2023 à 23:30, Frank Li a écrit :
> VCNL4035 register(0xE) ID_L and ID_M define as:
> 
>   ID_L: 0x80
>   ID_H: 7:6 (0:0)
>         5:4 (0:0) slave address = 0x60 (7-bit)
>             (0:1) slave address = 0x51 (7-bit)
>             (1:0) slave address = 0x40 (7-bit)
>             (1:0) slave address = 0x41 (7-bit)
>         3:0 Version code default	(0:0:0:0)
> 
> So just check ID_L.
> 
> Fixes: 55707294c4eb ("iio: light: Add support for vishay vcnl4035")
> 
> Signed-off-by: Frank Li <Frank.Li-3arQi8VN3Tc@...lic.gmane.org>
> ---
>   drivers/iio/light/vcnl4035.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/light/vcnl4035.c b/drivers/iio/light/vcnl4035.c
> index 3ed37f6057fb..8b7769930f3b 100644
> --- a/drivers/iio/light/vcnl4035.c
> +++ b/drivers/iio/light/vcnl4035.c
> @@ -413,7 +413,7 @@ static int vcnl4035_init(struct vcnl4035_data *data)
>   		return ret;
>   	}
>   
> -	if (id != VCNL4035_DEV_ID_VAL) {
> +	if ((id & 0xff) != VCNL4035_DEV_ID_VAL) {
>   		dev_err(&data->client->dev, "Wrong id, got %x, expected %x\n",
>   			id, VCNL4035_DEV_ID_VAL);

Hi,
should the error message be updated as well?

Cj

>   		return -ENODEV;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ