diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2005-09-13 04:25:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-13 11:22:27 -0400 |
commit | 4aed0644d684428e811bb6944f032b460a3ab165 (patch) | |
tree | 4b69f949865fec1c42f7d90fb4d459483c38df5f /drivers/base/platform.c | |
parent | 299cc3c166f7a11f6cc3b66aafbaf75c2aa0e0e2 (diff) |
[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 | |||
225 | struct platform_object *pobj; | 225 | struct platform_object *pobj; |
226 | int retval; | 226 | int retval; |
227 | 227 | ||
228 | pobj = kmalloc(sizeof(struct platform_object) + sizeof(struct resource) * num, GFP_KERNEL); | 228 | pobj = kzalloc(sizeof(*pobj) + sizeof(struct resource) * num, GFP_KERNEL); |
229 | if (!pobj) { | 229 | if (!pobj) { |
230 | retval = -ENOMEM; | 230 | retval = -ENOMEM; |
231 | goto error; | 231 | goto error; |
232 | } | 232 | } |
233 | 233 | ||
234 | memset(pobj, 0, sizeof(*pobj)); | ||
235 | pobj->pdev.name = name; | 234 | pobj->pdev.name = name; |
236 | pobj->pdev.id = id; | 235 | pobj->pdev.id = id; |
237 | pobj->pdev.dev.release = platform_device_release_simple; | 236 | pobj->pdev.dev.release = platform_device_release_simple; |