i2o: replaced string duplication code with kstrdup
PATCH 1/1 i2o: replaced string duplication code with kstrdup
i2o_pool_alloc now uses kstrdup instead of duplicating its implementation.
Found usinc coccinelle.
Signed-off-by Dragos Foianu <[email protected]>
--- drivers/message/i2o/memory.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/message/i2o/memory.c +1 -2
@@ -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 );
Signature · 1 line
1.7.10.4