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 <[email protected]> Reviewed-by: Tudor Ambarus <[email protected]> Reviewed-by: Michael Walle <[email protected]> Reviewed-by: Dan Carpenter <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
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)