diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2005-09-13 10:25:01 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-13 17:22:27 +0200 |
commit | 4aed0644d684428e811bb6944f032b460a3ab165 (patch) | |
tree | 4b69f949865fec1c42f7d90fb4d459483c38df5f /drivers/base/platform.c | |
parent | Fix up more strange byte writes to the PCI_ROM_ADDRESS config word (diff) | |
download | linux-4aed0644d684428e811bb6944f032b460a3ab165.tar.xz linux-4aed0644d684428e811bb6944f032b460a3ab165.zip |
[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>
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r-- | drivers/base/platform.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 3a5f4c991797..361e204209eb 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -225,13 +225,12 @@ struct platform_device *platform_device_register_simple(char *name, unsigned int struct platform_object *pobj; int retval; - pobj = kmalloc(sizeof(struct platform_object) + sizeof(struct resource) * num, GFP_KERNEL); + pobj = kzalloc(sizeof(*pobj) + sizeof(struct resource) * num, GFP_KERNEL); if (!pobj) { retval = -ENOMEM; goto error; } - memset(pobj, 0, sizeof(*pobj)); pobj->pdev.name = name; pobj->pdev.id = id; pobj->pdev.dev.release = platform_device_release_simple; |