mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
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: 1648eaaa15 ("mtd: cfi_cmdset_0002: Support Persistent Protection Bits (PPB) locking")
Cc: stable@vger.kernel.org
Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
This commit is contained in:
parent
0cd8116f17
commit
f1ce87f608
1 changed files with 2 additions and 0 deletions
|
|
@ -2676,6 +2676,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++;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue