mtd: physmap_of: fix cmdline partition method w/o linux, mtd-name

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Jan 28 11:59:01 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=7dfe4be351e81656ca1068e5d4ead235c7ba94b1
Commit:     7dfe4be351e81656ca1068e5d4ead235c7ba94b1
Parent:     bf65aaa637cabae0386fe46b1ad5cd16997474f5
Author:     Baruch Siach <baruch at tkos.co.il>
AuthorDate: Sun Dec 23 13:10:50 2012 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sat Jan 19 09:53:45 2013 +0000

    mtd: physmap_of: fix cmdline partition method w/o linux, mtd-name
    
    Commit d68cbdd4fb (mtd: physmap_of: allow to specify the mtd name for retro
    compatiblity) broke cmdline partitioning using dev_name() in the kernel command
    line.  of_property_read_string() does not touch mtd_name when linux,mtd-name is
    not present in the device tree, which causes map.name to be set to a random
    value.  Fix this by initializing mtd_name to NULL.
    
    Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
    Signed-off-by: Baruch Siach <baruch at tkos.co.il>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/maps/physmap_of.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 37cdc20..6fb2bd8 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -170,7 +170,7 @@ static int of_flash_probe(struct platform_device *dev)
 	resource_size_t res_size;
 	struct mtd_part_parser_data ppdata;
 	bool map_indirect;
-	const char *mtd_name;
+	const char *mtd_name = NULL;
 
 	match = of_match_device(of_flash_match, &dev->dev);
 	if (!match)



More information about the linux-mtd-cvs mailing list