qcacld-3.0: Add pointer check before dereferencing

Make sure the parsed association request array is valid at the
association ID index, before dereferencing it. This will prevent NULL
pointer deref. There is already a check for the beginning of the parsed
assoc req array, but it is not checking at the assoc ID index.

Change-Id: Icac3b2a4a0646dec4c64a2224e3271b0842a8194
CRs-Fixed: 3147273
diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_assoc_utils.c b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_assoc_utils.c
index 4be3a1b..112a3d7 100644
--- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_assoc_utils.c
+++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_assoc_utils.c
@@ -2579,9 +2579,11 @@ lim_add_sta(tpAniSirGlobal mac_ctx,
 			assoc_req =
 			(tpSirAssocReq) session_entry->parsedAssocReq[aid];
 
-			add_sta_params->wpa_rsn = assoc_req->rsnPresent;
-			add_sta_params->wpa_rsn |=
-				(assoc_req->wpaPresent << 1);
+			if (assoc_req) {
+				add_sta_params->wpa_rsn = assoc_req->rsnPresent;
+				add_sta_params->wpa_rsn |=
+					(assoc_req->wpaPresent << 1);
+			}
 		}
 	}