From: Jesper Juhl Date: Sat, 30 Oct 2010 21:43:05 +0000 (+0200) Subject: kmemleak: remove memset by using kzalloc X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0a08739e81671de2cb690774937fe510c000b27f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Minchan Kim Signed-off-by: Catalin Marinas --- diff --git a/mm/kmemleak-test.c b/mm/kmemleak-test.c index 177a5169bbde..ff0d9779cec8 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); }