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: <20171009173946.GB19253@dtor-ws>
Date:   Mon, 9 Oct 2017 10:39:46 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Christos Gkekas <chris.gekas@...il.com>
Cc:     linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Input: synaptics-rmi4: Clean up redundant check

On Sun, Oct 08, 2017 at 11:26:51PM +0100, Christos Gkekas wrote:
> Variable size_presence_regĀ·is unsigned so checking whether it is less
> than zero is redundant.
> 
> Signed-off-by: Christos Gkekas <chris.gekas@...il.com>

I'd rather we kept the check as it documents the valid range of values.

> ---
>  drivers/input/rmi4/rmi_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
> index 4f2bb59..68fcb30 100644
> --- a/drivers/input/rmi4/rmi_driver.c
> +++ b/drivers/input/rmi4/rmi_driver.c
> @@ -601,7 +601,7 @@ int rmi_read_register_desc(struct rmi_device *d, u16 addr,
>  		return ret;
>  	++addr;
>  
> -	if (size_presence_reg < 0 || size_presence_reg > 35)
> +	if (size_presence_reg > 35)
>  		return -EIO;
>  
>  	memset(buf, 0, sizeof(buf));
> -- 
> 2.7.4
> 

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ