android_kernel_xiaomi_sm8450/drivers/mtd/parsers
Linus Walleij 37bb57908d mtd: parsers: bcm47xxpart: Fix halfblock reads
[ Upstream commit 05e258c6ec669d6d18c494ea03d35962d6f5b545 ]

There is some code in the parser that tries to read 0x8000
bytes into a block to "read in the middle" of the block. Well
that only works if the block is also 0x10000 bytes all the time,
else we get these parse errors as we reach the end of the flash:

spi-nor spi0.0: mx25l1606e (2048 Kbytes)
mtd_read error while parsing (offset: 0x200000): -22
mtd_read error while parsing (offset: 0x201000): -22
(...)

Fix the code to do what I think was intended.

Cc: stable@vger.kernel.org
Fixes: f0501e81fb ("mtd: bcm47xxpart: alternative MAGIC for board_data partition")
Cc: Rafał Miłecki <zajec5@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20221018091129.280026-1-linus.walleij@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-10 18:14:21 +01:00
..
afs.c mtd: parsers: afs: Fix freeing the part name memory in failure 2021-03-04 11:37:45 +01:00
ar7part.c mtd: parsers: Move TI AR7 parser 2019-09-15 23:50:48 +02:00
bcm47xxpart.c mtd: parsers: bcm47xxpart: Fix halfblock reads 2022-11-10 18:14:21 +01:00
bcm63xxpart.c mtd: parsers: bcm63xx: simplify CFE detection 2020-06-26 08:35:10 +02:00
cmdlinepart.c mtd: parser: cmdline: Fix parsing of part-names with colons 2020-12-30 11:54:23 +01:00
Kconfig mtd: parsers: bcm63xx: Do not make it modular 2020-10-02 09:09:08 +02:00
Makefile mtd: parsers: Move CMDLINE parser 2019-09-15 23:50:50 +02:00
ofpart.c mtd: partitions: ofpart: Parse the slc-mode property 2020-05-11 09:51:42 +02:00
parser_imagetag.c mtd: parser: imagetag: fix error codes in bcm963xx_parse_imagetag_partitions() 2021-03-04 11:37:44 +01:00
parser_trx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
redboot.c mtd: partitions: Fix refcount leak in parse_redboot_of 2022-08-21 15:15:53 +02:00
sharpslpart.c mtd: sharpslpart: Fix unsigned comparison to zero 2020-01-21 20:00:34 +01:00