mtd: spi-nor: Off by one in cqspi_setup_flash()
Subsystems (3)
PATCH 1/2 mtd: spi-nor: Off by one in cqspi_setup_flash()
There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the > should be >=.
Fixes 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller')
Signed-off-by Dan Carpenter <[email protected]>
drivers/mtd/spi-nor/cadence-quadspi.c +1 -1
@@ -1082,7 +1082,7 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np) goto err; } -if (cs >CQSPI_MAX_CHIPSELECT ) { +if (cs >=CQSPI_MAX_CHIPSELECT ) {dev_err (dev,"Chip select %d out of range.\n" , cs); goto err; }
Quoted 5 lines · Dan Carpenter
There are
CQSPI_MAX_CHIPSELECTelements in the ->f_pdata array so the > should be >=.Fixes 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller')Signed-off-by Dan Carpenter <[email protected]>
Reviewed-by Marek Vasut <[email protected]>
Quoted 14 lines
drivers/mtd/spi-nor/cadence-quadspi.c +1
-1@@ -1082,7 +1082,7 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np) goto err; } -if (cs >CQSPI_MAX_CHIPSELECT ) { +if (cs >=CQSPI_MAX_CHIPSELECT ) {dev_err (dev,"Chip select %d out of range.\n" , cs); goto err; }
Signature · 2 lines
Best regards, Marek Vasut
Cyrille Pitchen
AppliedQuoted 8 lines · Marek Vasut
Quoted 5 lines · Dan Carpenter
There are
CQSPI_MAX_CHIPSELECTelements in the ->f_pdata array so the > should be >=.Fixes 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller')Signed-off-by Dan Carpenter <[email protected]>Reviewed-by Marek Vasut <[email protected]>
Applied to git://github.com/spi-nor/linux.git
Thanks!
Quoted 9 lines
Quoted 9 lines
drivers/mtd/spi-nor/cadence-quadspi.c +0
-0@@ -1082,7 +1082,7 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np) goto err; }
Quoted 8 lines
drivers/mtd/spi-nor/cadence-quadspi.c static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np) · line 1088
Quoted 6 lines
drivers/mtd/spi-nor/cadence-quadspi.c +1
-1-if (cs >CQSPI_MAX_CHIPSELECT ) { +if (cs >=CQSPI_MAX_CHIPSELECT ) {dev_err (dev,"Chip select %d out of range.\n" , cs); goto err; }
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html