Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757852AbbLBLRj (ORCPT ); Wed, 2 Dec 2015 06:17:39 -0500 Received: from 8bytes.org ([81.169.241.247]:40406 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757011AbbLBLRh (ORCPT ); Wed, 2 Dec 2015 06:17:37 -0500 Date: Wed, 2 Dec 2015 12:17:35 +0100 From: Joerg Roedel To: Catalin Marinas Cc: Michael Wang , iommu@lists.linux-foundation.org, Linux Kernel Mailing List Subject: Re: [RFC PATCH v2] iommu/amd: gray the 'irq_remap_table' object for kmemleak Message-ID: <20151202111735.GC18805@8bytes.org> References: <564EFF6A.2050709@profitbricks.com> <564F051E.9010703@profitbricks.com> <20151125150806.GG2064@8bytes.org> <5655D072.1000901@profitbricks.com> <565EC9F4.2050401@profitbricks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1321 Lines: 37 On Wed, Dec 02, 2015 at 10:52:02AM +0000, Catalin Marinas wrote: > diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c > index 013bdfff2d4d..c41609f71cbe 100644 > --- a/drivers/iommu/amd_iommu_init.c > +++ b/drivers/iommu/amd_iommu_init.c > @@ -27,6 +27,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -1692,6 +1693,7 @@ static struct syscore_ops amd_iommu_syscore_ops = { > > static void __init free_on_init_error(void) > { > + kmemleak_free(irq_lookup_table); > free_pages((unsigned long)irq_lookup_table, > get_order(rlookup_table_size)); > > @@ -1906,6 +1908,7 @@ static int __init early_amd_iommu_init(void) > irq_lookup_table = (void *)__get_free_pages( > GFP_KERNEL | __GFP_ZERO, > get_order(rlookup_table_size)); > + kmemleak_alloc(irq_lookup_table, rlookup_table_size, 1, GFP_KERNEL); > if (!irq_lookup_table) > goto out; > } Yes, this looks way better. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/