mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
mtd: nandsim: use kasprintf()
Use kasprintf() which combines kmalloc and sprintf. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
08efe91a1b
commit
f03a572928
1 changed files with 1 additions and 3 deletions
|
@ -654,9 +654,7 @@ static void free_device(struct nandsim *ns)
|
|||
|
||||
static char *get_partition_name(int i)
|
||||
{
|
||||
char buf[64];
|
||||
sprintf(buf, "NAND simulator partition %d", i);
|
||||
return kstrdup(buf, GFP_KERNEL);
|
||||
return kasprintf(GFP_KERNEL, "NAND simulator partition %d", i);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue