From patchwork Mon Jun 21 06:46:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 107138 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5L6ktDq025078 for ; Mon, 21 Jun 2010 06:46:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754107Ab0FUGqv (ORCPT ); Mon, 21 Jun 2010 02:46:51 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:59275 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751751Ab0FUGqu (ORCPT ); Mon, 21 Jun 2010 02:46:50 -0400 Received: by fxm10 with SMTP id 10so1551486fxm.19 for ; Sun, 20 Jun 2010 23:46:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=iRfuOCO4nrOKzWn1FlZSlPqLpuEJb4danrXlA2nq/Ig=; b=jSQhTJncadxRC9XiWaQGVUODvvGEHQtfvO3qxtk7OAVqvqxrYe4PVFDYJvgDktiazN psQc50n9pvd/9enARwGJpl4Dse+cNh6skJSWoTU3kbKI9IjP7j53uCvE5ayu0i+WNLdK uYKWtXnxza1ghQhqUUC+qotFXbVs7z+BrcoO0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=OWTt97swCgNRogDkG16mfSrKtcDzQ3qFAbYpXa1IClQHH4Xuvwtu0BTKhWwgo9YXpR m3NdsnJGXpcedVrNkbQpN5d95ttIRsoQrp3I5YGnRWUrGQkZDEIRzUt0/J0RuhJPD0e4 x0tRT76p+maH3biRJsOTeCcq/squHmeicwT8s= Received: by 10.223.143.12 with SMTP id s12mr4512672fau.9.1277102808906; Sun, 20 Jun 2010 23:46:48 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id r25sm26718510fai.35.2010.06.20.23.46.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 20 Jun 2010 23:46:48 -0700 (PDT) Date: Mon, 21 Jun 2010 08:46:35 +0200 From: Dan Carpenter To: Jesse Barnes Cc: David Woodhouse , Len Brown , Chris Wright , Yinghai Lu , linux-pci@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] pci: off by one in dmar_get_fault_reason() Message-ID: <20100621064635.GB5940@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 21 Jun 2010 06:46:55 +0000 (UTC) diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index 0a19708..3043636 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c @@ -1208,7 +1208,7 @@ static const char *intr_remap_fault_reasons[] = const char *dmar_get_fault_reason(u8 fault_reason, int *fault_type) { - if (fault_reason >= 0x20 && (fault_reason <= 0x20 + + if (fault_reason >= 0x20 && (fault_reason < 0x20 + ARRAY_SIZE(intr_remap_fault_reasons))) { *fault_type = INTR_REMAP; return intr_remap_fault_reasons[fault_reason - 0x20];