diff options
| author | Jiri Slaby <[email protected]> | 2005-09-13 08:25:01 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2005-09-13 15:22:27 +0000 |
| commit | 4aed0644d684428e811bb6944f032b460a3ab165 (patch) | |
| tree | 4b69f949865fec1c42f7d90fb4d459483c38df5f /drivers/base/attribute_container.c | |
| parent | Fix up more strange byte writes to the PCI_ROM_ADDRESS config word (diff) | |
| download | kernel-4aed0644d684428e811bb6944f032b460a3ab165.tar.gz kernel-4aed0644d684428e811bb6944f032b460a3ab165.zip | |
[PATCH] drivers/base/*: use kzalloc instead of kmalloc+memset
Fixes a bunch of memset bugs too.
Signed-off-by: Lion Vollnhals <[email protected]>
Signed-off-by: Jiri Slaby <[email protected]>
Cc: Greg KH <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/base/attribute_container.c')
| -rw-r--r-- | drivers/base/attribute_container.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/base/attribute_container.c b/drivers/base/attribute_container.c index 373e7b728fa7..6b2eb6f39b4d 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); |
