net: wl12xx: do not use kfree'd memory
authorKulikov Vasiliy <segooon@gmail.com>
Sat, 31 Jul 2010 16:33:59 +0000 (20:33 +0400)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 4 Aug 2010 19:27:38 +0000 (15:27 -0400)
wl1271_dump() uses cmd after kfree(cmd). Move kfree() just after
wl1271_dump().

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Acked-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/wl1271_spi.c

index 96d25fb..4cb99c5 100644 (file)
@@ -160,9 +160,8 @@ static void wl1271_spi_init(struct wl1271 *wl)
        spi_message_add_tail(&t, &m);
 
        spi_sync(wl_to_spi(wl), &m);
-       kfree(cmd);
-
        wl1271_dump(DEBUG_SPI, "spi init -> ", cmd, WSPI_INIT_CMD_LEN);
+       kfree(cmd);
 }
 
 #define WL1271_BUSY_WORD_TIMEOUT 1000