From 4aed0644d684428e811bb6944f032b460a3ab165 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Tue, 13 Sep 2005 01:25:01 -0700 Subject: [PATCH] drivers/base/*: use kzalloc instead of kmalloc+memset Fixes a bunch of memset bugs too. Signed-off-by: Lion Vollnhals Signed-off-by: Jiri Slaby Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/base/attribute_container.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/base/attribute_container.c') diff --git a/drivers/base/attribute_container.c b/drivers/base/attribute_container.c index 373e7b728fa..6b2eb6f39b4 100644 --- a/drivers/base/attribute_container.c +++ b/drivers/base/attribute_container.c @@ -152,12 +152,13 @@ attribute_container_add_device(struct device *dev, if (!cont->match(cont, dev)) continue; - ic = kmalloc(sizeof(struct internal_container), GFP_KERNEL); + + ic = kzalloc(sizeof(*ic), GFP_KERNEL); if (!ic) { dev_printk(KERN_ERR, dev, "failed to allocate class container\n"); continue; } - memset(ic, 0, sizeof(struct internal_container)); + ic->cont = cont; class_device_initialize(&ic->classdev); ic->classdev.dev = get_device(dev); -- cgit v1.2.3