|
@@ -891,7 +891,7 @@ void lim_send_sme_start_bss_rsp(struct mac_context *mac,
|
|
|
uint16_t size = 0;
|
|
|
struct scheduler_msg mmhMsg = {0};
|
|
|
struct start_bss_rsp *pSirSmeRsp;
|
|
|
- uint16_t ieLen;
|
|
|
+ uint16_t beacon_length, ieLen;
|
|
|
uint16_t ieOffset, curLen;
|
|
|
|
|
|
pe_debug("Sending message: %s with reasonCode: %s",
|
|
@@ -906,8 +906,13 @@ void lim_send_sme_start_bss_rsp(struct mac_context *mac,
|
|
|
} else {
|
|
|
/* subtract size of beaconLength + Mac Hdr + Fixed Fields before SSID */
|
|
|
ieOffset = sizeof(tAniBeaconStruct) + SIR_MAC_B_PR_SSID_OFFSET;
|
|
|
- ieLen = pe_session->schBeaconOffsetBegin
|
|
|
- + pe_session->schBeaconOffsetEnd - ieOffset;
|
|
|
+ beacon_length = pe_session->schBeaconOffsetBegin +
|
|
|
+ pe_session->schBeaconOffsetEnd;
|
|
|
+ ieLen = beacon_length - ieOffset;
|
|
|
+
|
|
|
+ /* Invalidate for non-beaconing entities */
|
|
|
+ if (beacon_length <= ieOffset)
|
|
|
+ ieLen = ieOffset = 0;
|
|
|
/* calculate the memory size to allocate */
|
|
|
size += ieLen;
|
|
|
|