[PATCH] drivers/base/*: use kzalloc instead of kmalloc+memset

Fixes a bunch of memset bugs too.

Signed-off-by: Lion Vollnhals <webmaster@schiggl.de>
Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Jiri Slaby 2005-09-13 01:25:01 -07:00 committed by Linus Torvalds
parent 299cc3c166
commit 4aed0644d6
5 changed files with 12 additions and 18 deletions

View file

@ -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);