wl1251: Fix memory leaks in SPI initialization
authorYuri Ershov <ext-yuri.ershov@nokia.com>
Wed, 27 Oct 2010 10:46:19 +0000 (14:46 +0400)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 5 Mar 2011 21:18:01 +0000 (23:18 +0200)
This patch fixes two memory leaks in the SPI initialization code.

Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
drivers/net/wireless/wl12xx/wl1251_spi.c

index 113df61..7a198f7 100644 (file)
@@ -72,6 +72,8 @@ static void wl1251_spi_reset(struct wl1251 *wl)
        spi_sync(wl_to_spi(wl), &m);
 
        wl1251_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN);
+
+       kfree(cmd);
 }
 
 static void wl1251_spi_wake(struct wl1251 *wl)
@@ -126,6 +128,8 @@ static void wl1251_spi_wake(struct wl1251 *wl)
        spi_sync(wl_to_spi(wl), &m);
 
        wl1251_dump(DEBUG_SPI, "spi init -> ", cmd, WSPI_INIT_CMD_LEN);
+
+       kfree(cmd);
 }
 
 static void wl1251_spi_reset_wake(struct wl1251 *wl)