lkml.org 
[lkml]   [2018]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] mtd: rawnand: docg4: fix NULL deref while probing
Date
nand_scan_tail() invokes nand_chip->scan_bbt() at the end, which is not set
by the driver. Use the default nand_default_bbt() function to avoid NULL
dereferncing.

Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
---
drivers/mtd/nand/raw/docg4.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/raw/docg4.c b/drivers/mtd/nand/raw/docg4.c
index bb96cb33cd6b..bbed8ea7858c 100644
--- a/drivers/mtd/nand/raw/docg4.c
+++ b/drivers/mtd/nand/raw/docg4.c
@@ -1269,6 +1269,7 @@ static void __init init_mtd_structs(struct mtd_info *mtd)
nand->read_buf = docg4_read_buf;
nand->write_buf = docg4_write_buf16;
nand->erase = docg4_erase_block;
+ nand->scan_bbt = nand_default_bbt;
nand->set_features = nand_get_set_features_notsupp;
nand->get_features = nand_get_set_features_notsupp;
nand->ecc.read_page = docg4_read_page;
--
2.18.0
\
 
 \ /
  Last update: 2018-07-08 13:31    [W:0.041 / U:1.860 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site