Staging: rt2860sta: prevent a panic when disabling when associated
authorDarren Salt <linux@youmustbejoking.demon.co.uk>
Wed, 14 Oct 2009 01:19:22 +0000 (02:19 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 14 Oct 2009 21:14:40 +0000 (14:14 -0700)
This fixes a panic which is triggered when the hardware "disappears" from
beneath the driver, i.e. when wireless is toggled off via Fn-F2 on various
EeePC models.

Ref. bug report http://bugzilla.kernel.org/show_bug.cgi?id=13390
          panic http://bugzilla.kernel.org/attachment.cgi?id=21928

Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rt2860/common/cmm_data_2860.c

index fb1735533b74c1d84091f6f35a36b4c31b9a7734..857ff450b6c9dbd8798980bd5364a76ba0e60ce1 100644 (file)
@@ -363,6 +363,8 @@ int RtmpPCIMgmtKickOut(
        ULONG                   SwIdx = pAd->MgmtRing.TxCpuIdx;
 
        pTxD  = (PTXD_STRUC) pAd->MgmtRing.Cell[SwIdx].AllocVa;
+       if (!pTxD)
+               return 0;
 
        pAd->MgmtRing.Cell[SwIdx].pNdisPacket = pPacket;
        pAd->MgmtRing.Cell[SwIdx].pNextNdisPacket = NULL;