summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2010-10-30 23:43:05 +0200
committerCatalin Marinas <catalin.marinas@arm.com>2011-01-27 18:31:51 +0000
commit0a08739e81671de2cb690774937fe510c000b27f (patch)
tree132c09b71ccb54cfbf26e7ee96f074783708b9c6 /mm
parent3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 (diff)
downloadlinux-3.10-0a08739e81671de2cb690774937fe510c000b27f.tar.gz
linux-3.10-0a08739e81671de2cb690774937fe510c000b27f.tar.bz2
linux-3.10-0a08739e81671de2cb690774937fe510c000b27f.zip
kmemleak: remove memset by using kzalloc
We don't need to memset if we just use kzalloc() rather than kmalloc() in kmemleak_test_init(). Signed-off-by: Jesper Juhl <jj@chaosbits.net> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/kmemleak-test.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/kmemleak-test.c b/mm/kmemleak-test.c
index 177a5169bbd..ff0d9779cec 100644
--- a/mm/kmemleak-test.c
+++ b/mm/kmemleak-test.c
@@ -75,13 +75,11 @@ static int __init kmemleak_test_init(void)
* after the module is removed.
*/
for (i = 0; i < 10; i++) {
- elem = kmalloc(sizeof(*elem), GFP_KERNEL);
- pr_info("kmemleak: kmalloc(sizeof(*elem)) = %p\n", elem);
+ elem = kzalloc(sizeof(*elem), GFP_KERNEL);
+ pr_info("kmemleak: kzalloc(sizeof(*elem)) = %p\n", elem);
if (!elem)
return -ENOMEM;
- memset(elem, 0, sizeof(*elem));
INIT_LIST_HEAD(&elem->list);
-
list_add_tail(&elem->list, &test_list);
}