Skip to content

Commit 2842dc9

Browse files
musamaanjummiquelraynal
authored andcommitted
mtd: spi-nor: core: correct type of i
The i should be signed to find out the end of the loop. Otherwise, i >= 0 is always true and loop becomes infinite. Make its type to be int. Fixes: 6a9eda3 ("mtd: spi-nor: core: set mtd->eraseregions for non-uniform erase map") Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Reviewed-by: Michael Walle <mwalle@kernel.org> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240304090103.818092-1-usama.anjum@collabora.com
1 parent 8c8d25d commit 2842dc9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mtd/spi-nor/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3373,7 +3373,7 @@ static u32
33733373
spi_nor_get_region_erasesize(const struct spi_nor_erase_region *region,
33743374
const struct spi_nor_erase_type *erase_type)
33753375
{
3376-
u8 i;
3376+
int i;
33773377

33783378
if (region->overlaid)
33793379
return region->size;

0 commit comments

Comments
 (0)