From 072de836f53be56a70cecf70b43ae43b7ce17376 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 11 Dec 2023 10:08:36 +0000
Subject: [PATCH] mk-rootfs.sh
---
kernel/drivers/mtd/nand/bbt.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/kernel/drivers/mtd/nand/bbt.c b/kernel/drivers/mtd/nand/bbt.c
index 64af689..7bf7278 100644
--- a/kernel/drivers/mtd/nand/bbt.c
+++ b/kernel/drivers/mtd/nand/bbt.c
@@ -116,7 +116,10 @@
if (entry >= nanddev_neraseblocks(nand))
return -ERANGE;
- pos[0] &= ~GENMASK(offs + bits_per_block - 1, offs);
+ if (bits_per_block + offs > BITS_PER_LONG)
+ pos[0] &= ~GENMASK(BITS_PER_LONG - 1, offs);
+ else
+ pos[0] &= ~GENMASK(offs + bits_per_block - 1, offs);
pos[0] |= val << offs;
if (bits_per_block + offs > BITS_PER_LONG) {
--
Gitblit v1.6.2