From: Joerg Roedel Date: Fri, 22 Jan 2010 15:40:20 +0000 (+0100) Subject: x86/amd-iommu: Fix possible integer overflow X-Git-Tag: v2.6.33-rc7~53^2~4^2~4 X-Git-Url: http://bbs.cooldavid.org/git/?a=commitdiff_plain;h=d91afd15b041f27d34859c79afa9e172018a86f4;p=net-next-2.6.git x86/amd-iommu: Fix possible integer overflow The variable i in this function could be increased to over 2**32 which would result in an integer overflow when using int. Fix it by changing i to unsigned long. Cc: stable@kernel.org Signed-off-by: Joerg Roedel --- diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 23824fef789..c2ccbd7b862 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c @@ -980,7 +980,7 @@ static int alloc_new_range(struct dma_ops_domain *dma_dom, { int index = dma_dom->aperture_size >> APERTURE_RANGE_SHIFT; struct amd_iommu *iommu; - int i; + unsigned long i; #ifdef CONFIG_IOMMU_STRESS populate = false;