From patchwork Thu May 21 20:12:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 25290 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 n4LKD6da007067 for ; Thu, 21 May 2009 20:13:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753894AbZEUUND (ORCPT ); Thu, 21 May 2009 16:13:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754533AbZEUUND (ORCPT ); Thu, 21 May 2009 16:13:03 -0400 Received: from mail-ew0-f176.google.com ([209.85.219.176]:45262 "EHLO mail-ew0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753894AbZEUUNC (ORCPT ); Thu, 21 May 2009 16:13:02 -0400 Received: by ewy24 with SMTP id 24so1458334ewy.37 for ; Thu, 21 May 2009 13:13:02 -0700 (PDT) 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=Ia1EaubSkXj5VMTas3rwj1OYL8qLWYegKq9Y0G5Rrb4=; b=f2Yad2NeZpYio+b57Ct1j9P4eskTfb6SVLlP73198s4L/yx+pyLTQgAY36mSHfebZF cmorLQ3i4mtlzBu+aw4Z8tF/4MwUNLnmEe5/LOIcW/eD155seGaP3DqffA3kJp/S7oar oZVSmkQU+7UlAPGkEq2G3R0XMxTFs3kjsa4tY= 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=OJ9x6ix2XUyOc+AcbWiBjV4oG6hDvs2SU/ax4NWfN256Bg7QhOObnZVQnjgmW+Spex O8RKZxOVXcYyxzDB56sCJy+dAcF+YDMC1PPZ8BWTL8mL7iEXIkjd6P0SHfuAtYa9Hpqg Pp6NT7iCEoakBPyiZF6NF9l5OrFK7zYLlVtD0= Received: by 10.210.52.15 with SMTP id z15mr3787896ebz.26.1242936778777; Thu, 21 May 2009 13:12:58 -0700 (PDT) Received: from ?192.168.1.2? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 10sm5430787eyd.42.2009.05.21.13.12.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 21 May 2009 13:12:58 -0700 (PDT) Message-ID: <4A15B5CA.9060907@gmail.com> Date: Thu, 21 May 2009 22:12:58 +0200 From: Roel Kluin User-Agent: Thunderbird 2.0.0.21 (X11/20090302) MIME-Version: 1.0 To: len.brown@intel.com CC: linux-sh@vger.kernel.org, Andrew Morton Subject: [PATCH] panasonic-laptop: beyond ARRAY_SIZE of pcc->keymap Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Do not go beyond ARRAY_SIZE of pcc->keymap Signed-off-by: Roel Kluin --- This is against linux-next -- To unsubscribe from this list: send the line "unsubscribe linux-sh" 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/misc/panasonic-laptop.c b/drivers/misc/panasonic-laptop.c index 4a1bc64..d82d1cc 100644 --- a/drivers/misc/panasonic-laptop.c +++ b/drivers/misc/panasonic-laptop.c @@ -515,7 +515,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));