From patchwork Sat Oct 17 06:34:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 54494 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 n9H6Z8rQ011064 for ; Sat, 17 Oct 2009 06:35:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751501AbZJQGei (ORCPT ); Sat, 17 Oct 2009 02:34:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751486AbZJQGei (ORCPT ); Sat, 17 Oct 2009 02:34:38 -0400 Received: from mgw1.diku.dk ([130.225.96.91]:51658 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751397AbZJQGeh (ORCPT ); Sat, 17 Oct 2009 02:34:37 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw1.diku.dk (Postfix) with ESMTP id 136D252C3DD; Sat, 17 Oct 2009 08:34:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at diku.dk Received: from mgw1.diku.dk ([127.0.0.1]) by localhost (mgw1.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xq6yGOAWgX1m; Sat, 17 Oct 2009 08:34:39 +0200 (CEST) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw1.diku.dk (Postfix) with ESMTP id CC11452C3A8; Sat, 17 Oct 2009 08:34:39 +0200 (CEST) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id 1ABAA6DF8B3; Sat, 17 Oct 2009 08:32:05 +0200 (CEST) Received: by ask.diku.dk (Postfix, from userid 3767) id B3916F9B1; Sat, 17 Oct 2009 08:34:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id ACBE4F9B0; Sat, 17 Oct 2009 08:34:39 +0200 (CEST) Date: Sat, 17 Oct 2009 08:34:39 +0200 (CEST) From: Julia Lawall To: Len Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 5/14] drivers/acpi: Move dereference after NULL test Message-ID: MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index 4c6c14c..1c5d7a8 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -1133,15 +1133,15 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) 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.