lkml.org 
[lkml]   [2013]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] mtd: physmap_of: fix illegal dereference
Date
d68cbdd introduced a new way of getting the name of an mtd
partion. The character pointer is not initialized, and only
checked against NULL, not at other random garbage.
This patch fixes the resulting panic.

Signed-off-by: Stef van Os <stef.van.os@prodrive.nl>
---
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 67cc73c..7901d72 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


\
 
 \ /
  Last update: 2013-01-17 20:02    [W:0.190 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site