From: Catalin Marinas Date: Sat, 17 May 2014 13:19:27 +0000 (+1000) Subject: lib/radix-tree.c: update the kmemleak stack trace for radix tree allocations X-Git-Tag: next-20140519~3^2~24 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fdec6be7caf6934c8f8ca7698bd8fafb7cfbf4cd;p=karo-tx-linux.git lib/radix-tree.c: update the kmemleak stack trace for radix tree allocations Since radix_tree_preload() stack trace is not always useful for debugging an actual radix tree memory leak, this patch updates the kmemleak allocation stack trace in the radix_tree_node_alloc() function. Signed-off-by: Catalin Marinas Acked-by: Johannes Weiner Signed-off-by: Andrew Morton --- diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 55f7a9c27312..6ad8130f2053 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -200,6 +201,11 @@ radix_tree_node_alloc(struct radix_tree_root *root) rtp->nodes[rtp->nr - 1] = NULL; rtp->nr--; } + /* + * Update the allocation stack trace as this is more useful + * for debugging. + */ + kmemleak_update_trace(ret); } if (ret == NULL) ret = kmem_cache_alloc(radix_tree_node_cachep, gfp_mask);