Re: [patch] move null check earlier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Julia's patch to fix this shipped in Linux-2.6.32-rc7

cheers,
Len Brown, Intel Open Source Technology Center

On Tue, 10 Nov 2009, Dan Carpenter wrote:

> I moved the null dereference after the check.  It is unlikely to make any 
> difference, but it's the right thing to do and it makes my static checker 
> happy.
> 
> regards,
> dan carpenter
> 
> Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
> 
> --- orig/drivers/acpi/processor_throttling.c	2009-11-08 19:26:09.000000000 +0200
> +++ devel/drivers/acpi/processor_throttling.c	2009-11-08 19:27:10.000000000 +0200
> @@ -1133,15 +1133,15 @@
>  	int result = 0;
>  	struct acpi_processor_throttling *pthrottling;
>  
> +	if (!pr)
> +		return -EINVAL;
> +
>  	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>  			  "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
>  			  pr->throttling.address,
>  			  pr->throttling.duty_offset,
>  			  pr->throttling.duty_width));
>  
> -	if (!pr)
> -		return -EINVAL;
> -
>  	/*
>  	 * Evaluate _PTC, _TSS and _TPC
>  	 * They must all be present or none of them can be used.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux