[PATCH] mtd: fix uninitialised mtd map name

Guennadi Liakhovetski g.liakhovetski at gmx.de
Sat Feb 2 16:48:38 EST 2013


Hi David

Do I see it right, that this patch didn't make it into the kernel on time 
for 3.8? Could you please, make sure it makes it to 3.9?

Thanks
Guennadi

On Mon, 31 Dec 2012, Guennadi Liakhovetski wrote:

> A recent commit "mtd: physmap_of: allow to specify the mtd name for retro
> compatiblity" introduced a regression: if no linux,mtd-name DT property is
> provided, the local mtd_name variable remains uninitialised and usually
> it's != NULL, which leads to a random garbage in MTD map name. Fix this by
> initialising the variable to NULL.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski at gmx.de>
> ---
> 
> Please, push to 3.8, unless already fixed.
> 
>  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)
> -- 
> 1.7.2.5
> 
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/



More information about the linux-mtd mailing list