mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
mwifiex: correct histogram data with appropriate index
[ Upstream commit 30bfce0b63 ]
Correct snr/nr/rssi data index to avoid possible buffer underflow.
Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f14629f347
commit
db6872750d
@@ -723,12 +723,14 @@ void mwifiex_hist_data_set(struct mwifiex_private *priv, u8 rx_rate, s8 snr,
|
||||
s8 nflr)
|
||||
{
|
||||
struct mwifiex_histogram_data *phist_data = priv->hist_data;
|
||||
s8 nf = -nflr;
|
||||
s8 rssi = snr - nflr;
|
||||
|
||||
atomic_inc(&phist_data->num_samples);
|
||||
atomic_inc(&phist_data->rx_rate[rx_rate]);
|
||||
atomic_inc(&phist_data->snr[snr]);
|
||||
atomic_inc(&phist_data->noise_flr[128 + nflr]);
|
||||
atomic_inc(&phist_data->sig_str[nflr - snr]);
|
||||
atomic_inc(&phist_data->snr[snr + 128]);
|
||||
atomic_inc(&phist_data->noise_flr[nf + 128]);
|
||||
atomic_inc(&phist_data->sig_str[rssi + 128]);
|
||||
}
|
||||
|
||||
/* function to reset histogram data during init/reset */
|
||||
|
||||
Reference in New Issue
Block a user