mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
Merge "qcacld-3.0: Fix underflow issue of beacon length"
This commit is contained in:
commit
43bab0792b
1 changed files with 14 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
|
|
@ -1171,20 +1171,28 @@ static void wma_update_beacon_noa_ie(struct beacon_info *bcn,
|
|||
/* TODO: Assuming p2p noa ie is last ie in the beacon */
|
||||
qdf_mem_zero(bcn->noa_ie, (bcn->noa_sub_ie_len +
|
||||
sizeof(struct p2p_ie)));
|
||||
bcn->len -= (bcn->noa_sub_ie_len +
|
||||
sizeof(struct p2p_ie));
|
||||
if (bcn->len < (bcn->noa_sub_ie_len +
|
||||
sizeof(struct p2p_ie)))
|
||||
bcn->len = 0;
|
||||
else
|
||||
bcn->len -= (bcn->noa_sub_ie_len +
|
||||
sizeof(struct p2p_ie));
|
||||
bcn->noa_ie = NULL;
|
||||
bcn->noa_sub_ie_len = 0;
|
||||
}
|
||||
wma_debug("No need to update NoA");
|
||||
return;
|
||||
}
|
||||
|
||||
if (bcn->noa_sub_ie_len && bcn->noa_ie) {
|
||||
if (bcn->len < (bcn->noa_sub_ie_len + sizeof(struct p2p_ie)))
|
||||
bcn->len = 0;
|
||||
else
|
||||
bcn->len -= (bcn->noa_sub_ie_len +
|
||||
sizeof(struct p2p_ie));
|
||||
|
||||
/* NoA present in previous beacon, update it */
|
||||
wma_debug("NoA present in previous beacon, update the NoA IE, bcn->len %u bcn->noa_sub_ie_len %u",
|
||||
bcn->len, bcn->noa_sub_ie_len);
|
||||
bcn->len -= (bcn->noa_sub_ie_len + sizeof(struct p2p_ie));
|
||||
bcn->len, bcn->noa_sub_ie_len);
|
||||
qdf_mem_zero(bcn->noa_ie,
|
||||
(bcn->noa_sub_ie_len + sizeof(struct p2p_ie)));
|
||||
} else { /* NoA is not present in previous beacon */
|
||||
|
|
|
|||
Loading…
Reference in a new issue