diff options
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; |