Linux ACPI
 help / color / mirror / Atom feed
* [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

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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox