diff options
| author | Sven Eckelmann <sven@narfation.org> | 2026-05-28 22:14:39 +0300 |
|---|---|---|
| committer | Sven Eckelmann <sven@narfation.org> | 2026-06-03 09:02:19 +0300 |
| commit | febfb1b86224489535312296ecfa3d4bf467f339 (patch) | |
| tree | a070c82e7741b8a426b56dc1a4dd39598efa5fa9 | |
| parent | b2b68b32a715e0328662801576974aa37b942b00 (diff) | |
| download | linux-febfb1b86224489535312296ecfa3d4bf467f339.tar.xz | |
batman-adv: tp_meter: initialize dec_cwnd explicitly
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>
| -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 8d7308327a9b..beabc264a4f1 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, * mesh_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 */ |
