diff options
author | Clément Viel <clement.viel@qorvo.com> | 2022-09-21 17:39:43 +0200 |
---|---|---|
committer | Victor Liu <victorliu@google.com> | 2022-09-21 16:05:24 +0000 |
commit | f3f108d0f96faa1e0f2e898f1f74213c46ce9346 (patch) | |
tree | 44539f5cc757549cc0cc1748735a926375af5774 | |
parent | 027a332ccad7cbdf8fed90970b3c9923fc71c7d1 (diff) | |
download | uwb-f3f108d0f96faa1e0f2e898f1f74213c46ce9346.tar.gz |
mac: limit rssi boundaries
Bug: 247788041
Change-Id: I9dfc7b9d7397e1f241caa939d4b220e45b1e129d
Signed-off-by: Clément Viel <clement.viel@qorvo.com>
-rw-r--r-- | mac/fira_access.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mac/fira_access.c b/mac/fira_access.c index dc9c99f..b03842e 100644 --- a/mac/fira_access.c +++ b/mac/fira_access.c @@ -709,9 +709,13 @@ static void fira_rx_frame(struct mcps802154_access *access, int frame_idx, error); if (info && info->flags & MCPS802154_RX_FRAME_INFO_RSSI) { + if ((ri->n_rx_rssis + 1) > FIRA_MESSAGE_ID_MAX) + return; + ri->rx_rssis[ri->n_rx_rssis++] = info->rssi < FIRA_RSSI_MAX ? info->rssi : FIRA_RSSI_MAX; } + if (fira_do_process_rx_frame(error, ri, slot->index)) { switch (slot->message_id) { case FIRA_MESSAGE_ID_RANGING_INITIATION: |