diff mbox

move null check earlier

Message ID alpine.DEB.2.00.0911081929420.10055@bicker (mailing list archive)
State RFC, archived
Headers show

Commit Message

Dan Carpenter Nov. 10, 2009, 8:56 a.m. UTC
None
diff mbox

Patch

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.