wl1271: Fix memory leaks in SPI initialization
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>
Fri, 26 Mar 2010 10:53:13 +0000 (12:53 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 31 Mar 2010 18:39:11 +0000 (14:39 -0400)
This patch fixes two memory leaks in the SPI initialization code.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/wl1271_spi.c

index db6c9f5..39b7dea 100644 (file)
@@ -104,6 +104,7 @@ static void wl1271_spi_reset(struct wl1271 *wl)
        spi_message_add_tail(&t, &m);
 
        spi_sync(wl_to_spi(wl), &m);
+       kfree(cmd);
 
        wl1271_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN);
 }
@@ -158,6 +159,7 @@ 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);
 }