From: Dan Carpenter Date: Tue, 21 Dec 2010 04:00:13 +0000 (+0300) Subject: wl12xx: use after free in debug code X-Git-Tag: v2.6.39-rc1~468^2~417^2~61^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0dd386676497fb3097e6fbb3de6090c948c0df30;p=platform%2Fkernel%2Flinux-exynos.git wl12xx: use after free in debug code If debugging is turned on, then wl1271_dump() dereferences a freed variable. Signed-off-by: Dan Carpenter Signed-off-by: Luciano Coelho --- diff --git a/drivers/net/wireless/wl12xx/spi.c b/drivers/net/wireless/wl12xx/spi.c index 46714910..8f7ea2c 100644 --- a/drivers/net/wireless/wl12xx/spi.c +++ b/drivers/net/wireless/wl12xx/spi.c @@ -110,9 +110,9 @@ 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); + kfree(cmd); } static void wl1271_spi_init(struct wl1271 *wl)