From 05e59e5fb0064c97a1c10921ecd549f2d4a58565 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Wed, 09 Oct 2024 06:14:40 +0000
Subject: [PATCH] add REDIRECT
---
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