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: <bc14cba3-5140-0e33-115c-56283b2ec44b@gmail.com>
Date:   Mon, 17 Apr 2017 11:53:02 -0700
From:   Tyrel Datwyler <turtle.in.the.kernel@...il.com>
To:     Colin King <colin.king@...onical.com>,
        "James E . J . Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K . Petersen" <martin.petersen@...cle.com>,
        linux-scsi@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: fc: remove redundant check of an unsigned long
 being less than zero

On 04/14/2017 06:58 AM, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
> 
> The check for an unsigned long being less than zero is always false
> so it is a redundant check and can be removed.
> 
> Detected by static analysis with by PVS-Studio
> 
> Signed-off-by: Colin Ian King <colin.king@...onical.com>

Reviewed-by: Tyrel Datwyler <tyreld@...ux.vnet.ibm.com>

> ---
>  drivers/scsi/scsi_transport_fc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
> index 2d753c93e07a..87b8f9d64d9b 100644
> --- a/drivers/scsi/scsi_transport_fc.c
> +++ b/drivers/scsi/scsi_transport_fc.c
> @@ -850,7 +850,7 @@ static int fc_str_to_dev_loss(const char *buf, unsigned long *val)
>  	char *cp;
>  
>  	*val = simple_strtoul(buf, &cp, 0);
> -	if ((*cp && (*cp != '\n')) || (*val < 0))
> +	if (*cp && (*cp != '\n'))
>  		return -EINVAL;
>  	/*
>  	 * Check for overflow; dev_loss_tmo is u32
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ