diff options
| -rw-r--r-- | drivers/acpi/scan.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 449c556274c0..8ab80bafe3f1 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
| @@ -1062,13 +1062,12 @@ static void acpi_add_id(struct acpi_device *device, const char *dev_id) | |||
| 1062 | if (!id) | 1062 | if (!id) |
| 1063 | return; | 1063 | return; |
| 1064 | 1064 | ||
| 1065 | id->id = kmalloc(strlen(dev_id) + 1, GFP_KERNEL); | 1065 | id->id = kstrdup(dev_id, GFP_KERNEL); |
| 1066 | if (!id->id) { | 1066 | if (!id->id) { |
| 1067 | kfree(id); | 1067 | kfree(id); |
| 1068 | return; | 1068 | return; |
| 1069 | } | 1069 | } |
| 1070 | 1070 | ||
| 1071 | strcpy(id->id, dev_id); | ||
| 1072 | list_add_tail(&id->list, &device->pnp.ids); | 1071 | list_add_tail(&id->list, &device->pnp.ids); |
| 1073 | } | 1072 | } |
| 1074 | 1073 | ||
