mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
[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:
committed by
Linus Torvalds
parent
299cc3c166
commit
4aed0644d6
@@ -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);
|
||||
|
Reference in New Issue
Block a user