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: <0a15738e38ef9fa0444d1f224657859deb2ed9d1.camel@hadess.net>
Date:   Thu, 27 Feb 2020 18:50:27 +0100
From:   Bastien Nocera <hadess@...ess.net>
To:     Icenowy Zheng <icenowy@...c.io>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Ondrej Jirman <megous@...ous.com>
Cc:     linux-input@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/3] Input: goodix - use string-based chip ID

On Fri, 2020-02-28 at 00:08 +0800, Icenowy Zheng wrote:
> For Goodix GT917S chip, the chip ID string is "917S", which contains
> not
> only numbers now.
> 
> Use string-based chip ID in the driver to support this chip and
> further
> chips with alphanumber ID.
> 
> Signed-off-by: Icenowy Zheng <icenowy@...c.io>
> ---
> Changes in v2:
> - Used a table to save ID and chip data info.
> - Use strscpy().
> 
>  drivers/input/touchscreen/goodix.c | 61 +++++++++++++++++-----------
> --
>  1 file changed, 35 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/goodix.c
> b/drivers/input/touchscreen/goodix.c
> index 0403102e807e..dde85b894ca4 100644
> --- a/drivers/input/touchscreen/goodix.c
> +++ b/drivers/input/touchscreen/goodix.c
> @@ -37,6 +37,11 @@ struct goodix_chip_data {
>  	int (*check_config)(struct goodix_ts_data *, const struct
> firmware *);
>  };
>  
> +struct goodix_chip_id {
> +	const char *id;
> +	const struct goodix_chip_data *data;
> +};
> +
>  struct goodix_ts_data {
>  	struct i2c_client *client;
>  	struct input_dev *input_dev;
> @@ -48,7 +53,7 @@ struct goodix_ts_data {
>  	struct regulator *vddio;
>  	struct gpio_desc *gpiod_int;
>  	struct gpio_desc *gpiod_rst;
> -	u16 id;
> +	char id[5];

Could you please change this "5" into a constant (#define) to make sure
that...
<snip>
> +	strscpy(ts->id, id_str, 5);

...we copy the same length here. Otherwise you can be certain it's
going to cause problems in the future.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ