summaryrefslogtreecommitdiff
path: root/drivers/staging/i2o
diff options
context:
space:
mode:
authorAbdul Hussain S <hussain.abdul@outlook.com>2015-03-18 14:46:00 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-20 13:44:39 +0100
commitd38f486142b6edf3dfd3407d8f0e8a55309a9e41 (patch)
tree8111065779834bb9eb1030136584141fc1304734 /drivers/staging/i2o
parent7a48a091962ec4f96c12038d11a15998ec28017b (diff)
staging: i2o: Use kstrdup rather than duplicating its implementation
The semantic patch that makes this change is available in scripts/coccinelle/api/kstrdup.cocci Signed-off-by: Abdul Hussain S <hussain.abdul@outlook.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/i2o')
-rw-r--r--drivers/staging/i2o/memory.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/i2o/memory.c b/drivers/staging/i2o/memory.c
index 8f9509d275a4..78b702c18537 100644
--- a/drivers/staging/i2o/memory.c
+++ b/drivers/staging/i2o/memory.c
@@ -270,10 +270,9 @@ EXPORT_SYMBOL_GPL(i2o_dma_realloc);
int i2o_pool_alloc(struct i2o_pool *pool, const char *name,
size_t size, int min_nr)
{
- pool->name = kmalloc(strlen(name) + 1, GFP_KERNEL);
+ pool->name = kstrdup(name, GFP_KERNEL);
if (!pool->name)
goto exit;
- strcpy(pool->name, name);
pool->slab =
kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL);