]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/mtd/chips/cfi_cmdset_0002.c
mtd: cfi_cmdset_0002: Fix unlocking requests crossing a chip boudary
[mirror_ubuntu-bionic-kernel.git] / drivers / mtd / chips / cfi_cmdset_0002.c
index b6cbe683c9c20fd81c96ee946ebff938a4240c02..c3e90e67f3f4f187f960ad09ce8f598f0da2f883 100644 (file)
@@ -2669,7 +2669,7 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs,
                 * sectors shall be unlocked, so lets keep their locking
                 * status at "unlocked" (locked=0) for the final re-locking.
                 */
-               if ((adr < ofs) || (adr >= (ofs + len))) {
+               if ((offset < ofs) || (offset >= (ofs + len))) {
                        sect[sectors].chip = &cfi->chips[chipnum];
                        sect[sectors].adr = adr;
                        sect[sectors].locked = do_ppb_xxlock(