* [patch] move null check earlier
@ 2009-11-10 8:56 Dan Carpenter
2009-12-09 20:39 ` Len Brown
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2009-11-10 8:56 UTC (permalink / raw)
To: linux-acpi
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@gmail.com>
--- 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] move null check earlier
2009-11-10 8:56 [patch] move null check earlier Dan Carpenter
@ 2009-12-09 20:39 ` Len Brown
0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2009-12-09 20:39 UTC (permalink / raw)
To: Dan Carpenter; +Cc: linux-acpi
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@gmail.com>
>
> --- 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@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-09 20:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-10 8:56 [patch] move null check earlier Dan Carpenter
2009-12-09 20:39 ` Len Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.