]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
commit3145ac392d9eb548e2258cc422a5156a761dbd0f
tree263c200fa96fcfebf9421d21ff3a44f8ce55e18c
parentec7ac9f44d91cd22cd5e35da2ca8057b6ad891fd
mtd: cfi_cmdset_0002: Fix unlocking requests crossing a chip boudary

BugLink: http://bugs.launchpad.net/bugs/1807469
commit 0cd8116f172eed018907303dbff5c112690eeb91 upstream.

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: 1648eaaa1575 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/mtd/chips/cfi_cmdset_0002.c