staging: wilc1000: bug fix on memory free
authorGlen Lee <glen.lee@atmel.com>
Mon, 21 Dec 2015 05:18:50 +0000 (14:18 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Dec 2015 21:21:09 +0000 (13:21 -0800)
Set tx_buffer to NULL not to free again the memory that is already freed,
which could cause system crash when device is failed.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_wlan.c

index 00f3464..83af51b 100644 (file)
@@ -1374,6 +1374,7 @@ void wilc_wlan_cleanup(struct net_device *dev)
        kfree(wilc->rx_buffer);
        wilc->rx_buffer = NULL;
        kfree(wilc->tx_buffer);
+       wilc->tx_buffer = NULL;
 
        acquire_bus(wilc, ACQUIRE_AND_WAKEUP);