]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: cfi_cmdset_0002: Fix unlocking requests crossing a chip boudary
authorJoakim Tjernlund <joakim.tjernlund@infinera.com>
Wed, 6 Jun 2018 10:13:29 +0000 (12:13 +0200)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Thu, 21 Jun 2018 22:55:16 +0000 (00:55 +0200)
commit0c64e4d7cb71b619a85ea4bd5910ff2b8afe74df
treefe0e8f01fb5e02d158fa26a64beacb764de8797f
parent82fe704c0c8aefb926ce3b8b8e9d2d6cb006c563
mtd: cfi_cmdset_0002: Fix unlocking requests crossing a chip boudary

The "sector is in requested range" test used to determine whether
sectors should be re-locked or not is done on a variable that is reset
everytime we cross a chip boundary, which can lead to some blocks being
re-locked while the caller expect them to be unlocked.
Fix the check to make sure this cannot happen.

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