-
由 Boris Brezillon 提交于
commit ad4635153034c20c6f6e211e2ed3fd38b658649a upstream. Commit 33f45c44 ("mtd: Do not allow MTD devices with inconsistent erase properties") introduced a check to make sure ->erasesize and ->_erase values are consistent with the MTD_NO_ERASE flag. This patch did not take the 0 bytes partition case into account which can happen when the defined partition is outside the flash device memory range. Fix that by setting the partition erasesize to the parent erasesize. Fixes: 33f45c44 ("mtd: Do not allow MTD devices with inconsistent erase properties") Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org> Cc: <stable@vger.kernel.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
3ca59bf1