summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorThomas Meyer <thomas@m3y3r.de>2011-08-06 11:32:56 +0200
committerLen Brown <len.brown@intel.com>2011-11-06 19:13:44 -0500
commit581de59e8dff8eaa52809e768a585e9ef336aa4a (patch)
treea89fecb0d2edb1ea9256fbe16676def28b0dff93 /drivers
parentc3b92c8787367a8bb53d57d9789b558f1295cc96 (diff)
downloadlinux-581de59e8dff8eaa52809e768a585e9ef336aa4a.tar.bz2
ACPI: use kstrdup()
Use kstrdup rather than duplicating its implementation The semantic patch that makes this output is available in scripts/coccinelle/api/kstrdup.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/scan.c3
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)
if (!id)
return;
- id->id = kmalloc(strlen(dev_id) + 1, GFP_KERNEL);
+ id->id = kstrdup(dev_id, GFP_KERNEL);
if (!id->id) {
kfree(id);
return;
}
- strcpy(id->id, dev_id);
list_add_tail(&id->list, &device->pnp.ids);
}