]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: cfi_cmdset_0002: fix SEGV unlocking multiple chips
authorJoakim Tjernlund <joakim.tjernlund@infinera.com>
Wed, 6 Jun 2018 10:13:28 +0000 (12:13 +0200)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Thu, 21 Jun 2018 22:35:31 +0000 (00:35 +0200)
commit82fe704c0c8aefb926ce3b8b8e9d2d6cb006c563
tree32530a1430fc449d292f8e3f91350286a9469a71
parent0f3267a697fac544e3f97873ac227e78e5f51282
mtd: cfi_cmdset_0002: fix SEGV unlocking multiple chips

cfi_ppb_unlock() tries to relock all sectors that were locked before
unlocking the whole chip.
This locking used the chip start address + the FULL offset from the
first flash chip, thereby forming an illegal address. Fix that by using
the chip offset(adr).

Fixes: a5833b6631f4 ("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>
drivers/mtd/chips/cfi_cmdset_0002.c