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: <200907300743.n6U7hnK6000821@mercury.physics.adelaide.edu.au>
Date:	Thu, 30 Jul 2009 17:13:49 +0930 (CST)
From:	Jonathan Woithe <jwoithe@...sics.adelaide.edu.au>
To:	bzolnier@...il.com (Bartlomiej Zolnierkiewicz)
Cc:	jwoithe@...sics.adelaide.edu.au (Jonathan Woithe),
	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	error27@...il.com (Dan Carpenter), corbet@....net,
	eteo@...hat.com, julia@...u.dk (Julia Lawall)
Subject: Re: [PATCH] fujitsu-laptop: remove superfluous NULL pointer checks

Hi Bart

> From: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
> Subject: [PATCH] fujitsu-laptop: remove superfluous NULL pointer checks
> 
> This takes care of the following entries from Dan's list:
> 
> drivers/platform/x86/fujitsu-laptop.c +327 set_lcd_level(13) warning: variable derefenced before check 'fujitsu'
> drivers/platform/x86/fujitsu-laptop.c +358 set_lcd_level_alt(13) warning: variable derefenced before check 'fujitsu'

I'd rather keep the test for a non-null fujitsu in there, but obviously it's
kind of pointless doing it after the first dereference.  Since this fixup
overlaps with the one previously discussed with Julia I've taken the liberty
of consolidating these - I'll send the result to the list as a separate
email.

Regards
  jonathan

> Reported-by: Dan Carpenter <error27@...il.com>
> Cc: corbet@....net
> Cc: eteo@...hat.com
> Cc: Julia Lawall <julia@...u.dk>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
> ---
>  drivers/platform/x86/fujitsu-laptop.c |    6 ------
>  1 file changed, 6 deletions(-)
> 
> Index: b/drivers/platform/x86/fujitsu-laptop.c
> ===================================================================
> --- a/drivers/platform/x86/fujitsu-laptop.c
> +++ b/drivers/platform/x86/fujitsu-laptop.c
> @@ -324,9 +324,6 @@ static int set_lcd_level(int level)
>  	if (level < 0 || level >= fujitsu->max_brightness)
>  		return -EINVAL;
>  
> -	if (!fujitsu)
> -		return -EINVAL;
> -
>  	status = acpi_get_handle(fujitsu->acpi_handle, "SBLL", &handle);
>  	if (ACPI_FAILURE(status)) {
>  		vdbg_printk(FUJLAPTOP_DBG_ERROR, "SBLL not present\n");
> @@ -355,9 +352,6 @@ static int set_lcd_level_alt(int level)
>  	if (level < 0 || level >= fujitsu->max_brightness)
>  		return -EINVAL;
>  
> -	if (!fujitsu)
> -		return -EINVAL;
> -
>  	status = acpi_get_handle(fujitsu->acpi_handle, "SBL2", &handle);
>  	if (ACPI_FAILURE(status)) {
>  		vdbg_printk(FUJLAPTOP_DBG_ERROR, "SBL2 not present\n");
--
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