CHROMIUM: iommu/exynos: Fix free now that we're using kmem_cache
authorDoug Anderson <dianders@chromium.org>
Wed, 12 Sep 2012 17:18:11 +0000 (10:18 -0700)
committerGerrit <chrome-bot@google.com>
Wed, 12 Sep 2012 18:08:31 +0000 (11:08 -0700)
The previous CL ("CHROMIUM: iommu/exynos: Fix allocation to be safer
in terms of alignment") introduced a potential bug where kfree() was
being called still in one case.  It doesn't appear that we run this
codepath in normal usage (so we actually have a memory leak), but it's
good to fix just in case.

BUG=chrome-os-partner:13948
TEST=boot with slub debugging turn on; play youtube video

Change-Id: Ie9aff3e180c95c6f9f3643efe8f98cf5b5693320
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33094
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Pawel Osciak <posciak@google.com>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
drivers/iommu/exynos-iommu.c

index 2541cdd..b0ee0e0 100644 (file)
@@ -903,7 +903,7 @@ static int lv1set_section(unsigned long *sent, phys_addr_t paddr, short *pgcnt)
                if (*pgcnt != NUM_LV2ENTRIES)
                        return -EADDRINUSE;
 
-               kfree(page_entry(sent, 0));
+               kmem_cache_free(lv2cache, page_entry(sent, 0));
 
                *pgcnt = 0;
        }