mtd: nand: assign mtd->name in find_full_id_nand
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Tue Jan 28 00:59:06 EST 2014
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=092b6a1dd0c82013f59c717b8f2ca057863183e3
Commit: 092b6a1dd0c82013f59c717b8f2ca057863183e3
Parent: 3e77216c2acf063d4233c73fb3edc189142ae439
Author: Cai Zhiyong <caizhiyong at huawei.com>
AuthorDate: Wed Dec 25 21:19:21 2013 +0800
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Sat Jan 11 12:07:18 2014 -0800
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 <caizhiyong at huawei.com>
Acked-by: Huang Shijie <b32955 at freescale.com>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
drivers/mtd/nand/nand_base.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 9b3bb3c..404e83d 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;
More information about the linux-mtd-cvs
mailing list