mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 22:21:21 +00: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:
parent
299cc3c166
commit
4aed0644d6
5 changed files with 12 additions and 18 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue