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: <20140610182719.GA28752@pd.tnic>
Date:	Tue, 10 Jun 2014 20:27:19 +0200
From:	Borislav Petkov <bp@...en8.de>
To:	Fabian Frederick <fabf@...net.be>
Cc:	linux-kernel@...r.kernel.org,
	Doug Thompson <dougthompson@...ssion.com>
Subject: Re: [PATCH 1/1] drivers/edac/edac_module.c: remove unnecessary test
 on unsigned value

On Mon, Jun 09, 2014 at 09:20:18PM +0200, Fabian Frederick wrote:
> unsigned long value is never < 0
> 
> Cc: Doug Thompson <dougthompson@...ssion.com>
> Cc: Borislav Petkov <bp@...en8.de>
> Signed-off-by: Fabian Frederick <fabf@...net.be>
> ---
>  drivers/edac/edac_module.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/edac/edac_module.c b/drivers/edac/edac_module.c
> index a66941f..e6d1691 100644
> --- a/drivers/edac/edac_module.c
> +++ b/drivers/edac/edac_module.c
> @@ -28,7 +28,7 @@ static int edac_set_debug_level(const char *buf, struct kernel_param *kp)
>  	if (ret)
>  		return ret;
>  
> -	if (val < 0 || val > 4)
> +	if (val > 4)
>  		return -EINVAL;

Ok, so I don't know how you caught this but FWIW, we have those W= build
switches which trigger it too (which is a good thing that we have them
:-))

$ make W=1 drivers/edac/edac_module.o

...

drivers/edac/edac_module.c: In function ‘edac_set_debug_level’:
drivers/edac/edac_module.c:31:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (val < 0 || val > 4)

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ