All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 1/2] mtd: spi-nor: Off by one in cqspi_setup_flash()
@ 2016-10-13  8:06 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2016-10-13  8:06 UTC (permalink / raw)
  To: David Woodhouse, Graham Moore
  Cc: Brian Norris, Marek Vasut, linux-mtd, kernel-janitors

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 <dan.carpenter@oracle.com>

diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c
index d403ba7..944863b 100644
--- a/drivers/mtd/spi-nor/cadence-quadspi.c
+++ b/drivers/mtd/spi-nor/cadence-quadspi.c
@@ -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;
 		}

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-11-28  8:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-13  8:06 [patch 1/2] mtd: spi-nor: Off by one in cqspi_setup_flash() Dan Carpenter
2016-10-13  8:06 ` Dan Carpenter
2016-10-14  7:19 ` Marek Vasut
2016-10-14  7:19   ` Marek Vasut
2016-11-28  8:19   ` Cyrille Pitchen
2016-11-28  8:19     ` Cyrille Pitchen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.