public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Kukjin Kim <kgene.kim@samsung.com>
Cc: Joerg Roedel <joerg.roedel@amd.com>,
	KyongHo Cho <pullip.cho@samsung.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] iommu: exynos: Fix out of bound array access
Date: Thu, 28 Mar 2013 14:19:10 +0800	[thread overview]
Message-ID: <1364451550.4448.1.camel@phoenix> (raw)

In the case of no-match in "for (i = 0; i < (pdev->num_resources / 2); i++)",
i is "pdev->num_resources / 2". Fix the boundary checking to avoid the out of
bound array access for data->sfrbases[i].

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/iommu/exynos-iommu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 238a3ca..de04e6a 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -357,7 +357,7 @@ static irqreturn_t exynos_sysmmu_irq(int irq, void *dev_id)
 			break;
 	}
 
-	if (i == pdev->num_resources) {
+	if (i == pdev->num_resources / 2) {
 		itype = SYSMMU_FAULT_UNKNOWN;
 	} else {
 		itype = (enum exynos_sysmmu_inttype)
-- 
1.7.10.4




                 reply	other threads:[~2013-03-28  6:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364451550.4448.1.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=joerg.roedel@amd.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pullip.cho@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox