From: Akinobu Mita Date: Sun, 28 Jul 2013 02:21:54 +0000 (+0900) Subject: mtd: nandsim: use kasprintf() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f03a5729287a8bc1eb061a2f849b5a33ed9cd3ab;p=openwrt%2Fstaging%2Fblogic.git mtd: nandsim: use kasprintf() Use kasprintf() which combines kmalloc and sprintf. Signed-off-by: Akinobu Mita Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index a73dce020816..ac1b46cbd33e 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c @@ -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); } /*