Linux ACPI
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: linux-acpi@vger.kernel.org
Subject: [patch] move null check earlier
Date: Tue, 10 Nov 2009 10:56:26 +0200 (SAST)	[thread overview]
Message-ID: <alpine.DEB.2.00.0911081929420.10055@bicker> (raw)

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.

             reply	other threads:[~2009-11-10  8:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-10  8:56 Dan Carpenter [this message]
2009-12-09 20:39 ` [patch] move null check earlier Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.0911081929420.10055@bicker \
    --to=error27@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox