WLAN:Fix for target assert for protected management frames

Firmware crashes if host sends protected management frames
before key installation in the firmware.Add check in the
Host, for key installation in firmware, before sending the
protected management frames.

Change-Id: I0d0ddea3762441fc022e412bddb438b4275d3734
CRs-fixed: 751076
diff --git a/CORE/MAC/src/pe/lim/limUtils.c b/CORE/MAC/src/pe/lim/limUtils.c
index 34852f2..8eae3c5 100644
--- a/CORE/MAC/src/pe/lim/limUtils.c
+++ b/CORE/MAC/src/pe/lim/limUtils.c
@@ -8256,10 +8256,17 @@
         pStaDs = dphLookupHashEntry( pMac, peer, &aid,
                                      &psessionEntry->dph.dphHashTable );
         if( pStaDs != NULL )
-            if( pStaDs->rmfEnabled )
+            /* rmfenabled will be set at the time of addbss.
+             * but sometimes EAP auth fails and keys are not
+             * installed then if we send any management frame
+             * like deauth/disassoc with this bit set then
+             * firmware crashes. so check for keys are
+             * installed or not also before setting the bit
+             */
+            if( pStaDs->rmfEnabled && psessionEntry->isKeyInstalled )
                 pMacHdr->fc.wep = 1;
     }
-    else if ( psessionEntry->limRmfEnabled )
+    else if ( psessionEntry->limRmfEnabled && psessionEntry->isKeyInstalled)
         pMacHdr->fc.wep = 1;
 } /*** end limSetProtectedBit() ***/
 #endif