From patchwork Tue Nov 10 08:56:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 58974 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAA8uvL0029946 for ; Tue, 10 Nov 2009 08:56:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752821AbZKJI4c (ORCPT ); Tue, 10 Nov 2009 03:56:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753918AbZKJI4b (ORCPT ); Tue, 10 Nov 2009 03:56:31 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:47467 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752821AbZKJI4b (ORCPT ); Tue, 10 Nov 2009 03:56:31 -0500 Received: by bwz27 with SMTP id 27so4301537bwz.21 for ; Tue, 10 Nov 2009 00:56:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to :subject:message-id:user-agent:mime-version:content-type; bh=qJuUfhek/5zTFvuL1q0cHuhfqzJn39Urlxa0xRHyKdE=; b=Y71slnsK9LR3m6aPk+uHw2OyKmxABFVr8JfhNxPQjBBmgxw82e/HqLHQ9x7HPmv6UI kyhR5sHbPwLrXvbYFwQxTY2wJR4UWnilHoy/qvJx33DCzib4nsVemK29Sq9GUSwXbNaC XZJw3wd0bLzcGyoCcAGyI274S0bxMNr3VIfzk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:subject:message-id:user-agent:mime-version :content-type; b=mNk6nPbrLQh+0xmHeexpzrXfRdNCjp6PLQBtqc1jvT/ZdPY5+6bWZnAC3ixZLebVXD 6yto1U9JzWezQXh2IJXTg2V2WE2r+x9t5ntvoHCKsuzsZwwzzaXobJvXWulSymPGZ0xk Y8MDM9nTIiGcgUoxs8/LeBxNk2OAmODkF5PPw= Received: by 10.204.148.85 with SMTP id o21mr2294387bkv.134.1257843395566; Tue, 10 Nov 2009 00:56:35 -0800 (PST) Received: from bicker.local ([41.222.20.196]) by mx.google.com with ESMTPS id 13sm138271bwz.10.2009.11.10.00.56.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 10 Nov 2009 00:56:34 -0800 (PST) Date: Tue, 10 Nov 2009 10:56:26 +0200 (SAST) From: Dan Carpenter X-X-Sender: dcarpenter@bicker To: linux-acpi@vger.kernel.org Subject: [patch] move null check earlier Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org difference, but it's the right thing to do and it makes my static checker happy. regards, dan carpenter Signed-off-by: Dan Carpenter --- 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.