Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07caec85 authored by Joakim Tjernlund's avatar Joakim Tjernlund Committed by Greg Kroah-Hartman
Browse files

mtd: cfi_cmdset_0002: Avoid walking all chips when unlocking.



commit f1ce87f6080b1dda7e7b1eda3da332add19d87b9 upstream.

cfi_ppb_unlock() walks all flash chips when unlocking sectors,
avoid walking chips unaffected by the unlock operation.

Fixes: 1648eaaa ("mtd: cfi_cmdset_0002: Support Persistent Protection Bits (PPB) locking")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJoakim Tjernlund <joakim.tjernlund@infinera.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 520516d1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2683,6 +2683,8 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs,
			i++;

		if (adr >> cfi->chipshift) {
			if (offset >= (ofs + len))
				break;
			adr = 0;
			chipnum++;