diff options
| author | Sven Eckelmann <sven@narfation.org> | 2026-06-26 18:11:01 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-04 13:41:29 +0200 |
| commit | ba32f3ab3beff73defb22a2fc987abba372f894c (patch) | |
| tree | 03cbe8f32688f000061256c2445ff6cd7179a236 | |
| parent | ab3ce14a7f04a8bfb1b8ec081c9d048d818b676c (diff) | |
| download | linux-stable-ba32f3ab3beff73defb22a2fc987abba372f894c.tar.gz linux-stable-ba32f3ab3beff73defb22a2fc987abba372f894c.zip | |
batman-adv: tp_meter: initialize dec_cwnd explicitly
commit febfb1b86224489535312296ecfa3d4bf467f339 upstream.
When batadv_tp_update_cwnd() is called, dec_cwnd is increased. But dec_cwnd
is only initialixed (to 0) when a duplicate Ack was received or when cwnd
is below the ss_threshold.
Just initialize the cwnd during the initialization to avoid any potential
access of uninitialized data.
Cc: stable@kernel.org
Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | net/batman-adv/tp_meter.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index 750e5e9d3dc9..f6ccb639744a 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -1055,6 +1055,8 @@ void batadv_tp_start(struct batadv_priv *bat_priv, const u8 *dst, * soft_interface, hence its MTU */ tp_vars->cwnd = BATADV_TP_PLEN * 3; + tp_vars->dec_cwnd = 0; + /* at the beginning initialise the SS threshold to the biggest possible * window size, hence the AWND size */ |
