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>
This commit is contained in:
Родитель
7a48a09196
Коммит
d38f486142
|
@ -270,10 +270,9 @@ EXPORT_SYMBOL_GPL(i2o_dma_realloc);
|
||||||
int i2o_pool_alloc(struct i2o_pool *pool, const char *name,
|
int i2o_pool_alloc(struct i2o_pool *pool, const char *name,
|
||||||
size_t size, int min_nr)
|
size_t size, int min_nr)
|
||||||
{
|
{
|
||||||
pool->name = kmalloc(strlen(name) + 1, GFP_KERNEL);
|
pool->name = kstrdup(name, GFP_KERNEL);
|
||||||
if (!pool->name)
|
if (!pool->name)
|
||||||
goto exit;
|
goto exit;
|
||||||
strcpy(pool->name, name);
|
|
||||||
|
|
||||||
pool->slab =
|
pool->slab =
|
||||||
kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL);
|
kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче