]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
arm: tegra: pm: suppress kmemleak false positive
authorAllen Yu <alleny@nvidia.com>
Mon, 26 May 2014 09:42:01 +0000 (17:42 +0800)
committerHarshada Kale <hkale@nvidia.com>
Fri, 30 May 2014 12:41:50 +0000 (05:41 -0700)
The memory block for relocating lp0 vector is referenced by
a physical address (i.e. tegra_lp0_vec_start) which kmemleak
can't detect. Mark it as not a leak to avoid false positive.

Bug 200007297

Change-Id: Ie137f08d77911677d9e76fdb7d0112a1610dd72d
Signed-off-by: Allen Yu <alleny@nvidia.com>
Reviewed-on: http://git-master/r/414946
Reviewed-by: Harshada Kale <hkale@nvidia.com>
Tested-by: Harshada Kale <hkale@nvidia.com>
arch/arm/mach-tegra/pm.c
arch/arm64/mach-tegra/pm.c

index e9dcc698cff42851eb257b6bb957d9c642fa2367..463db1152d6439fdcaba4b4a980869bd3cc4a5a5 100644 (file)
@@ -54,6 +54,7 @@
 #include <linux/tegra-cpuidle.h>
 #include <linux/irqchip/tegra.h>
 #include <linux/tegra-pm.h>
+#include <linux/kmemleak.h>
 
 #include <trace/events/power.h>
 #include <trace/events/nvsecurity.h>
@@ -1880,6 +1881,12 @@ void __init tegra_init_suspend(struct tegra_suspend_platform_data *plat)
                        goto out;
                }
 
+               /* Avoid a kmemleak false positive. The allocated memory
+                * block is later referenced by a physical address (i.e.
+                * tegra_lp0_vec_start) which kmemleak can't detect.
+                */
+               kmemleak_not_leak(reloc_lp0);
+
                orig = ioremap(tegra_lp0_vec_start, tegra_lp0_vec_size);
                WARN_ON(!orig);
                if (!orig) {
index c5ee44b91d19a66e4cf18029a139f44b7c1b0d0e..ea41fd36f75301f818259dc7d464c5b1ff5327d3 100644 (file)
@@ -52,6 +52,7 @@
 #include <linux/tegra-cpuidle.h>
 #include <linux/irqchip/tegra.h>
 #include <linux/tegra-pm.h>
+#include <linux/kmemleak.h>
 
 #include <trace/events/power.h>
 #include <trace/events/nvsecurity.h>
@@ -968,6 +969,12 @@ void __init tegra_init_suspend(struct tegra_suspend_platform_data *plat)
                        goto out;
                }
 
+               /* Avoid a kmemleak false positive. The allocated memory
+                * block is later referenced by a physical address (i.e.
+                * tegra_lp0_vec_start) which kmemleak can't detect.
+                */
+               kmemleak_not_leak(reloc_lp0);
+
                orig = ioremap(tegra_lp0_vec_start, tegra_lp0_vec_size);
                WARN_ON(!orig);
                if (!orig) {