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/platform.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/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; |
