]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
mtd: nand: assign mtd->name in find_full_id_nand
authorCai Zhiyong <caizhiyong@huawei.com>
Wed, 25 Dec 2013 13:19:21 +0000 (21:19 +0800)
committerBrian Norris <computersforpeace@gmail.com>
Sat, 11 Jan 2014 20:07:18 +0000 (12:07 -0800)
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@huawei.com>
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/nand_base.c

index 9b3bb3c519e9f632610f5e03faafa45ae3c648ee..404e83d7e3dad766c1d67c13dc19c398460af619 100644 (file)
@@ -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;