From patchwork Wed Feb 11 19:50:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 6712 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 n1BJoBnP025989 for ; Wed, 11 Feb 2009 19:50:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755942AbZBKTuK (ORCPT ); Wed, 11 Feb 2009 14:50:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753980AbZBKTuK (ORCPT ); Wed, 11 Feb 2009 14:50:10 -0500 Received: from mail-fx0-f20.google.com ([209.85.220.20]:48976 "EHLO mail-fx0-f20.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755942AbZBKTuJ (ORCPT ); Wed, 11 Feb 2009 14:50:09 -0500 Received: by fxm13 with SMTP id 13so1097102fxm.13 for ; Wed, 11 Feb 2009 11:50:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=BLZIPmciwtBK4PD6HTUIgqEE4LMxEAx9b8tdQLiNky8=; b=nX0S04I3hMNMZNVlzRpajrLYq46nCuMiDHHjQYBoHCWz+iSeVgPEV4c6ePspGzkjI5 r+GyJ61Pn7xxsWia/akt1HuEI0J+wW4DmnuEZOfy5LBESbqhWq2gtuEF60Y8VRnVqLmT 8Ex/l56/9b1KRoW6Vt30u28BP4kIlbkIKpW5g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=tqLGGqL3/UBrJ+sZ8mwadW2IxXJHHP1sw1UJ6lN0yCF+9TcX223NWcsAvvbqiyngBB KdRf74BOi/5cdHvPRyXbckUVlj62VThJicW8Z54NNnCt3wTdEsVqBBBPkmhPJyDD5VL+ 6CRoIddaZbur0N3/WokTY7xS72yvIdr2V22AI= Received: by 10.223.113.199 with SMTP id b7mr2254164faq.82.1234381806643; Wed, 11 Feb 2009 11:50:06 -0800 (PST) Received: from ?192.168.1.115? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id k9sm1368811nfh.22.2009.02.11.11.50.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 11 Feb 2009 11:50:05 -0800 (PST) Message-ID: <49932BF4.2010005@gmail.com> Date: Wed, 11 Feb 2009 20:50:12 +0100 From: Roel Kluin User-Agent: Thunderbird 2.0.0.18 (X11/20081105) MIME-Version: 1.0 To: lenb@kernel.org CC: linux-acpi@vger.kernel.org, Andrew Morton Subject: [PATCH] ACPI: get_throttling_state() cannot be larger state_count Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org With for(i = 0; i < n; i++) { ... } i reaches n. Signed-off-by: Roel Kluin acked-by: --- -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index d278381..6feb9ab 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -785,7 +785,7 @@ static int acpi_get_throttling_state(struct acpi_processor *pr, if (tx->control == value) break; } - if (i > pr->throttling.state_count) + if (i >= pr->throttling.state_count) i = -1; return i; }