kernel/drivers/mtd/nand/bbt.c
.. .. @@ -116,7 +116,10 @@ 116 116 if (entry >= nanddev_neraseblocks(nand)) 117 117 return -ERANGE; 118 118 119 - pos[0] &= ~GENMASK(offs + bits_per_block - 1, offs);119 + if (bits_per_block + offs > BITS_PER_LONG)120 + pos[0] &= ~GENMASK(BITS_PER_LONG - 1, offs);121 + else122 + pos[0] &= ~GENMASK(offs + bits_per_block - 1, offs);120 123 pos[0] |= val << offs; 121 124 122 125 if (bits_per_block + offs > BITS_PER_LONG) {