mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 05:29:04 -04:00
qcacmn: sanitize the range of local_id before using it
Sanitize the local_id before accessing to the local_peer_ids pool. Change-Id: I5cd2f19d493360d384de895dccfaf51d3008b5b7 CRs-fixed: 2247672
This commit is contained in:
parent
fa7a033cac
commit
9d56e3a4c0
1 changed files with 5 additions and 0 deletions
|
|
@ -2024,6 +2024,11 @@ void *dp_peer_find_by_local_id(struct cdp_pdev *pdev_handle, uint8_t local_id)
|
|||
struct dp_peer *peer;
|
||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
||||
|
||||
if (local_id >= OL_TXRX_NUM_LOCAL_PEER_IDS) {
|
||||
DP_TRACE(DEBUG, "Incorrect local id %d", local_id);
|
||||
QDF_BUG(0);
|
||||
return NULL;
|
||||
}
|
||||
qdf_spin_lock_bh(&pdev->local_peer_ids.lock);
|
||||
peer = pdev->local_peer_ids.map[local_id];
|
||||
qdf_spin_unlock_bh(&pdev->local_peer_ids.lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue