]> err.no Git - linux-2.6/commitdiff
[PATCH] SPI: at25: do not use pointer before assignment
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Fri, 16 Mar 2007 21:38:20 +0000 (13:38 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 17 Mar 2007 02:25:05 +0000 (19:25 -0700)
Prevents a potential oops with CONFIG_SPI_DEBUG given flakey hardware or
incorrect configuration.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/spi/at25.c

index 48e4f48e779f474d55e460dfd41fb1ec98b4bc6b..8efa07e8b8c2a7bef31ce118109b622e42de210d 100644 (file)
@@ -291,7 +291,7 @@ static int at25_probe(struct spi_device *spi)
         */
        sr = spi_w8r8(spi, AT25_RDSR);
        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;
                goto fail;
        }