diff options
-rw-r--r-- | drivers/base/platform.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 9e9227e1762d..c48c4acb9b87 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -165,7 +165,7 @@ EXPORT_SYMBOL_GPL(platform_add_devices); struct platform_object { struct platform_device pdev; - char name[1]; + char name[]; }; /** @@ -206,7 +206,7 @@ struct platform_device *platform_device_alloc(const char *name, int id) { struct platform_object *pa; - pa = kzalloc(sizeof(struct platform_object) + strlen(name), GFP_KERNEL); + pa = kzalloc(sizeof(*pa) + strlen(name) + 1, GFP_KERNEL); if (pa) { strcpy(pa->name, name); pa->pdev.name = pa->name; |