From: Yanjiang Jin Date: Fri, 27 Feb 2015 05:30:34 +0000 (+0800) Subject: powerpc/mm: Free string after creating kmem cache X-Git-Tag: omap-for-v4.1/fixes-rc1~126^2~73 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e77553cb21adabb7680930e7b20c578cec7ae5a8;p=pandora-kernel.git powerpc/mm: Free string after creating kmem cache kmem_cache_create()->kmem_cache_create_memcg()->kstrdup() allocates new space and copys name's content, so it is safe to free name memory after calling kmem_cache_create(). Else kmemleak will report the below warning: unreferenced object 0xc0000000f9002160 (size 16): comm "swapper/0", pid 0, jiffies 4294892296 (age 1386.640s) hex dump (first 16 bytes): 70 67 74 61 62 6c 65 2d 32 5e 39 00 de ad be ef pgtable-2^9..... backtrace: [] .kvasprintf+0x5c/0xa0 [] .kasprintf+0x2c/0x50 [] .pgtable_cache_add+0xac/0x100 [] .pgtable_cache_init+0x24/0x80 [] .start_kernel+0x228/0x4c8 [] .start_here_common+0x24/0x90 Signed-off-by: Yanjiang Jin Signed-off-by: Michael Ellerman --- Reading git-diff-tree failed