libertas: do not attempt to transmit during device removal

Marcelo Tosatti mtosatti at redhat.unroutablecom
Fri Nov 10 21:24:36 EST 2006


Commit:     d4803922e74d6594d917d348bac250e8e1c1d36b
Parent:     5ce7f4883d31bac6908f96065930ffb4bef4d8db
commit d4803922e74d6594d917d348bac250e8e1c1d36b
Author:     Marcelo Tosatti <mtosatti at redhat.com>
AuthorDate: Fri Nov 10 03:43:40 2006 +0000
Commit:     Marcelo Tosatti <marcelo at pentafluge.infradead.org>
CommitDate: Fri Nov 10 03:43:40 2006 +0000

    libertas: do not attempt to transmit during device removal
    
    TX routines might attempt to use freed device data during unload, causing
    oopses.
    
    Signed-off-by: Marcelo Tosatti <mtosatti at redhat.com>
---
 drivers/net/wireless/libertas/wlan_tx.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/libertas/wlan_tx.c b/drivers/net/wireless/libertas/wlan_tx.c
index 005364a..c0fbdb8 100644
--- a/drivers/net/wireless/libertas/wlan_tx.c
+++ b/drivers/net/wireless/libertas/wlan_tx.c
@@ -95,6 +95,9 @@ static int SendSinglePacket(wlan_private
 
 	ENTER();
 
+	if (priv->adapter->SurpriseRemoved)
+		return WLAN_STATUS_FAILURE;
+
 	if ((priv->adapter->debugmode & MRVDRV_DEBUG_TX_PATH) != 0)
 		HEXDUMP("TX packet: ", skb->data,
 			 min_t(unsigned int, skb->len, 100));


More information about the Commits-kernel mailing list