diff mbox

[16/23,BUG] SPI: array out of bound => no CS

Message ID 1344952177-18385-17-git-send-email-richard.genoud@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Richard Genoud Aug. 14, 2012, 1:49 p.m. UTC
---
 drivers/spi/spi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 3fb5b6d..74e6577 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -976,8 +976,8 @@  static int of_spi_register_master(struct spi_master *master)
 		return -ENOMEM;
 
 	memset(cs, -EINVAL, master->num_chipselect);
-	master->num_chipselect += nb;
 	cs += master->num_chipselect;
+	master->num_chipselect += nb;
 
 	for (i = 0; i < nb; i++)
 		cs[i] = of_get_named_gpio(np, "cs-gpios", i);