From: Cai Zhiyong Date: Wed, 25 Dec 2013 13:19:21 +0000 (+0800) Subject: mtd: nand: assign mtd->name in find_full_id_nand X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=092b6a1dd0c82013f59c717b8f2ca057863183e3;p=openwrt%2Fstaging%2Fblogic.git mtd: nand: assign mtd->name in find_full_id_nand This patch assigned the type->name to mtd->name when mtd->name is NULL in function "find_full_id_nand". mtd->name is NULL may cause some problem. Signed-off-by: Cai Zhiyong Acked-by: Huang Shijie Signed-off-by: Brian Norris --- diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 9b3bb3c519e9..404e83d7e3da 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -3327,6 +3327,9 @@ static bool find_full_id_nand(struct mtd_info *mtd, struct nand_chip *chip, *busw = type->options & NAND_BUSWIDTH_16; + if (!mtd->name) + mtd->name = type->name; + return true; } return false;