mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00: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