summaryrefslogtreecommitdiffstats
path: root/mm/kmemleak-test.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-31 12:55:38 +1000
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-31 12:55:38 +1000
commit4fda116852fe21a3897c478ce64b77bb1ec6b3d6 (patch)
treeae1dbc17d1223ba0debe3ca7f309e2eca82b6447 /mm/kmemleak-test.c
parent52cea8a4b0634421ddafcfef98c07cf5c378a71f (diff)
parent6ae4bd1f0bc479984f30061b5e5116060c24a267 (diff)
downloadop-kernel-dev-4fda116852fe21a3897c478ce64b77bb1ec6b3d6.zip
op-kernel-dev-4fda116852fe21a3897c478ce64b77bb1ec6b3d6.tar.gz
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-2.6-cm
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-2.6-cm: kmemleak: Allow kmemleak metadata allocations to fail kmemleak: remove memset by using kzalloc
Diffstat (limited to 'mm/kmemleak-test.c')
-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 177a516..ff0d977 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);
}
OpenPOWER on IntegriCloud