aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/sysfs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
index fcae5fa2e1b3..193745d96fcc 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
@@ -677,10 +677,9 @@ void acpi_irq_stats_init(void)
677 else 677 else
678 sprintf(buffer, "bug%02X", i); 678 sprintf(buffer, "bug%02X", i);
679 679
680 name = kzalloc(strlen(buffer) + 1, GFP_KERNEL); 680 name = kstrdup(buffer, GFP_KERNEL);
681 if (name == NULL) 681 if (name == NULL)
682 goto fail; 682 goto fail;
683 strncpy(name, buffer, strlen(buffer) + 1);
684 683
685 sysfs_attr_init(&counter_attrs[i].attr); 684 sysfs_attr_init(&counter_attrs[i].attr);
686 counter_attrs[i].attr.name = name; 685 counter_attrs[i].attr.name = name;