Skip to content

Commit f1ce87f

Browse files
joakim-tjernlundBoris Brezillon
authored andcommitted
mtd: cfi_cmdset_0002: Avoid walking all chips when unlocking.
cfi_ppb_unlock() walks all flash chips when unlocking sectors, avoid walking chips unaffected by the unlock operation. Fixes: 1648eaa ("mtd: cfi_cmdset_0002: Support Persistent Protection Bits (PPB) locking") Cc: [email protected] Signed-off-by: Joakim Tjernlund <[email protected]> Signed-off-by: Boris Brezillon <[email protected]>
1 parent 0cd8116 commit f1ce87f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/mtd/chips/cfi_cmdset_0002.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2676,6 +2676,8 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs,
26762676
i++;
26772677

26782678
if (adr >> cfi->chipshift) {
2679+
if (offset >= (ofs + len))
2680+
break;
26792681
adr = 0;
26802682
chipnum++;
26812683

0 commit comments

Comments
 (0)