Commit c6ca97d2 authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Linus Torvalds

[PATCH] SPI: at25: do not use pointer before assignment

Prevents a potential oops with CONFIG_SPI_DEBUG given flakey hardware or
incorrect configuration.
Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 13788ccc
...@@ -291,7 +291,7 @@ static int at25_probe(struct spi_device *spi) ...@@ -291,7 +291,7 @@ static int at25_probe(struct spi_device *spi)
*/ */
sr = spi_w8r8(spi, AT25_RDSR); sr = spi_w8r8(spi, AT25_RDSR);
if (sr < 0 || sr & AT25_SR_nRDY) { if (sr < 0 || sr & AT25_SR_nRDY) {
dev_dbg(&at25->spi->dev, "rdsr --> %d (%02x)\n", sr, sr); dev_dbg(&spi->dev, "rdsr --> %d (%02x)\n", sr, sr);
err = -ENXIO; err = -ENXIO;
goto fail; goto fail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment