mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-09 02:43:53 +08:00
ramips: fix kernel oops in mt7621_nfc_write_page_hwecc
`mt7621_nfc_write_page_hwecc` may be called with `buf=NULL`, but `mt7621_nfc_check_empty_page` always tries to read it. That caused Oops: `Unable to handle kernel paging request at virtual address 00000000` Fixes: FS#3416 Signed-off-by: Anton Ryzhov <anton@ryzhov.me>
This commit is contained in:
parent
be09c5a3cd
commit
df469befdc
@ -47,7 +47,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
obj-$(CONFIG_MTD_NAND_TEGRA) += tegra_nand.o
|
obj-$(CONFIG_MTD_NAND_TEGRA) += tegra_nand.o
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/mtd/nand/raw/mt7621_nand.c
|
+++ b/drivers/mtd/nand/raw/mt7621_nand.c
|
||||||
@@ -0,0 +1,1348 @@
|
@@ -0,0 +1,1350 @@
|
||||||
+// SPDX-License-Identifier: GPL-2.0
|
+// SPDX-License-Identifier: GPL-2.0
|
||||||
+/*
|
+/*
|
||||||
+ * MediaTek MT7621 NAND Flash Controller driver
|
+ * MediaTek MT7621 NAND Flash Controller driver
|
||||||
@ -1155,9 +1155,11 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
+ uint32_t i, j;
|
+ uint32_t i, j;
|
||||||
+ u8 *oobptr;
|
+ u8 *oobptr;
|
||||||
+
|
+
|
||||||
+ for (i = 0; i < mtd->writesize; i++)
|
+ if (buf) {
|
||||||
+ if (buf[i] != 0xff)
|
+ for (i = 0; i < mtd->writesize; i++)
|
||||||
+ return 0;
|
+ if (buf[i] != 0xff)
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
+ for (i = 0; i < nand->ecc.steps; i++) {
|
+ for (i = 0; i < nand->ecc.steps; i++) {
|
||||||
+ oobptr = oob_fdm_ptr(nand, i);
|
+ oobptr = oob_fdm_ptr(nand, i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user