developer | 8eb72a3 | 2023-03-30 08:32:07 +0800 | [diff] [blame^] | 1 | From d9ba3e35e1291613ca15875a065326fab80e5d6d Mon Sep 17 00:00:00 2001 |
developer | 1413c88 | 2023-02-15 00:01:06 +0800 | [diff] [blame] | 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
| 3 | Date: Thu, 9 Feb 2023 18:58:08 +0800 |
developer | 8eb72a3 | 2023-03-30 08:32:07 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 02/15] wifi: mac80211: make rate u32 in sta_set_rate_info_rx() |
developer | 1413c88 | 2023-02-15 00:01:06 +0800 | [diff] [blame] | 5 | |
| 6 | The value of last_rate in ieee80211_sta_rx_stats is degraded from u32 to |
| 7 | u16 after being assigned to rate variable, which causes information loss |
| 8 | in STA_STATS_FIELD_TYPE and later bitfields. |
| 9 | |
| 10 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
| 11 | --- |
| 12 | net/mac80211/sta_info.c | 2 +- |
| 13 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 14 | |
| 15 | diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c |
developer | 8eb72a3 | 2023-03-30 08:32:07 +0800 | [diff] [blame^] | 16 | index 8cdeb96..e32841a 100644 |
developer | 1413c88 | 2023-02-15 00:01:06 +0800 | [diff] [blame] | 17 | --- a/net/mac80211/sta_info.c |
| 18 | +++ b/net/mac80211/sta_info.c |
developer | 8eb72a3 | 2023-03-30 08:32:07 +0800 | [diff] [blame^] | 19 | @@ -2384,7 +2384,7 @@ static void sta_stats_decode_rate(struct ieee80211_local *local, u32 rate, |
developer | 1413c88 | 2023-02-15 00:01:06 +0800 | [diff] [blame] | 20 | |
| 21 | static int sta_set_rate_info_rx(struct sta_info *sta, struct rate_info *rinfo) |
| 22 | { |
| 23 | - u16 rate = READ_ONCE(sta_get_last_rx_stats(sta)->last_rate); |
| 24 | + u32 rate = READ_ONCE(sta_get_last_rx_stats(sta)->last_rate); |
| 25 | |
| 26 | if (rate == STA_STATS_RATE_INVALID) |
| 27 | return -EINVAL; |
| 28 | -- |
developer | 8eb72a3 | 2023-03-30 08:32:07 +0800 | [diff] [blame^] | 29 | 2.18.0 |
developer | 1413c88 | 2023-02-15 00:01:06 +0800 | [diff] [blame] | 30 | |