prima: WLAN Driver Release 3.2.0.10
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 2dac130..671904a 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2012, The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -3572,6 +3572,12 @@
 
       pSession = CSR_GET_SESSION(pMac, sessionId);
 
+      if(!pSession)
+      {
+         smsLog(pMac, LOGE, FL("  session %d not found "), sessionId);
+         return eHAL_STATUS_FAILURE;
+      }
+
       if(CSR_IS_INFRA_AP(&pSession->connectedProfile))
       {
          if(pSetKey->keyDirection == eSIR_TX_DEFAULT)
@@ -5274,6 +5280,12 @@
         tSirRegisterMgmtFrame *pMsg;
         tANI_U16 len;
         tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
+
+        if(!pSession)
+        {
+            smsLog(pMac, LOGE, FL("  session %d not found "), sessionId);
+            return eHAL_STATUS_FAILURE;
+        }
         
         if( !pSession->sessionActive )
         {
@@ -5325,6 +5337,12 @@
         tSirRegisterMgmtFrame *pMsg;
         tANI_U16 len;
         tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
+
+        if(!pSession)
+        {
+            smsLog(pMac, LOGE, FL("  session %d not found "), sessionId);
+            return eHAL_STATUS_FAILURE;
+        }
         
         if( !pSession->sessionActive ) 
         {
@@ -6457,6 +6475,12 @@
     {
         tpSirUpdateParams pMsg;
         tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
+
+        if(!pSession)
+        {
+            smsLog(pMac, LOGE, FL("  session %d not found "), sessionId);
+            return eHAL_STATUS_FAILURE;
+        }
         
         if( !pSession->sessionActive ) 
             VOS_ASSERT(0);