mtd: diskonchip: mem resource name is not optional

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Apr 5 02:59:06 EDT 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=86e4bbc766b9456f583f2fc3c4f6c623b422af88
Commit:     86e4bbc766b9456f583f2fc3c4f6c623b422af88
Parent:     148256fa0bb8e05a00db3f204b36e19e6312102c
Author:     Sasha Levin <sasha.levin at oracle.com>
AuthorDate: Wed Mar 19 18:24:37 2014 -0400
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Mon Mar 31 18:43:22 2014 -0700

    mtd: diskonchip: mem resource name is not optional
    
    Passing a name to request_mem_region() isn't optional and can't just
    be NULL. Passing NULL causes a NULL ptr deref later in the boot
    process.
    
    Signed-off-by: Sasha Levin <sasha.levin at oracle.com>
    Tested-by: Alexander Shiyan <shc_work at mail.ru>
    Cc: <stable at vger.kernel.org> # 3.14
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/diskonchip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
index b9b4db6..f68a7bc 100644
--- a/drivers/mtd/nand/diskonchip.c
+++ b/drivers/mtd/nand/diskonchip.c
@@ -1439,7 +1439,7 @@ static int __init doc_probe(unsigned long physadr)
 	int reg, len, numchips;
 	int ret = 0;
 
-	if (!request_mem_region(physadr, DOC_IOREMAP_LEN, NULL))
+	if (!request_mem_region(physadr, DOC_IOREMAP_LEN, "DiskOnChip"))
 		return -EBUSY;
 	virtadr = ioremap(physadr, DOC_IOREMAP_LEN);
 	if (!virtadr) {



More information about the linux-mtd-cvs mailing list