mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
mtd: spi-nor: Off by one in cqspi_setup_flash()
commit193e87143cupstream. There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the > should be >=. Fixes:1406234105('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ebdfcaa14e
commit
e55e6c026b
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user