From patchwork Sat Jan 17 14:51:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 2941 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 n0HEsqgB014323 for ; Sat, 17 Jan 2009 06:54:52 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757880AbZAQO7H (ORCPT ); Sat, 17 Jan 2009 09:59:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757829AbZAQO7H (ORCPT ); Sat, 17 Jan 2009 09:59:07 -0500 Received: from mail-ew0-f12.google.com ([209.85.219.12]:34323 "EHLO mail-ew0-f12.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757880AbZAQO7G (ORCPT ); Sat, 17 Jan 2009 09:59:06 -0500 X-Greylist: delayed 456 seconds by postgrey-1.27 at vger.kernel.org; Sat, 17 Jan 2009 09:59:05 EST Received: by ewy5 with SMTP id 5so268991ewy.13 for ; Sat, 17 Jan 2009 06:59:04 -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=yL8L0HVS/a59xGTLg4/9hmiaGySdjv7DDAQvZmgLmsE=; b=NIhLnjM6jDLuAtrwdTcge0ZKmuYNti4pGBh8h7ImU5lvp2AG46Ji92eut7Tk3OI2QU u7kcmNAbdy2uqnJaf665stva4DPTccFaAcdao8tWDZY8o64PAt5ihlEe1PZpfq9E9car GH15SllXUEzg+q9gSwf4o33cfOwmVT9eFi24g= 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=AQmwNW/4Z7t1DauY8Lec08paPJt2Z2P02c/CxqNNozXSzhMhk0xPs5SlyDfJ4y/L/e 2vCnbABmeTZweSFeHAkTOdZlGrV6UPfaKVrAqWiR4s+A5s4dbeVHyKNUXcyPIw8un59R oUyZatZFj4UfqZxF0mMP+4ZrdTAUQjPoSJsyk= Received: by 10.210.58.13 with SMTP id g13mr1224629eba.79.1232203887887; Sat, 17 Jan 2009 06:51:27 -0800 (PST) Received: from ?192.168.1.115? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id i8sm7709174nfh.50.2009.01.17.06.51.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 17 Jan 2009 06:51:27 -0800 (PST) Message-ID: <4971F06F.9030309@gmail.com> Date: Sat, 17 Jan 2009 15:51:27 +0100 From: Roel Kluin User-Agent: Thunderbird 2.0.0.18 (X11/20081105) MIME-Version: 1.0 To: len.brown@intel.com CC: linux-acpi@vger.kernel.org Subject: [PATCH] fix X[ ARRAY_SIZE(X) ] Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Ensure pcc->keymap[ ARRAY_SIZE(pcc->keymap) ] does not occur. Signed-off-by: Roel Kluin --- -- 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/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index f30db36..c47a44d 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -507,7 +507,7 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc) hkey_num = result & 0xf; - if (hkey_num < 0 || hkey_num > ARRAY_SIZE(pcc->keymap)) { + if (hkey_num < 0 || hkey_num >= ARRAY_SIZE(pcc->keymap)) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "hotkey number out of range: %d\n", hkey_num));