Commit 77927b7d9dd6c9c5f59f0f49c76cda54b908090e

Authored by Sven Eckelmann
Committed by Antonio Quartulli
1 parent a121048a89

batman-adv: Return EINVAL on invalid gw_bandwidth change

Invalid speed settings by the user are currently acknowledged as correct
but not stored. Instead the return of the store operation of the file
"gw_bandwidth" should indicate that the given value is not acceptable.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

net/batman-adv/gateway_common.c
... ... @@ -19,6 +19,7 @@
19 19 #include "main.h"
20 20  
21 21 #include <linux/atomic.h>
  22 +#include <linux/errno.h>
22 23 #include <linux/byteorder/generic.h>
23 24 #include <linux/kernel.h>
24 25 #include <linux/netdevice.h>
... ... @@ -160,7 +161,7 @@
160 161  
161 162 ret = batadv_parse_gw_bandwidth(net_dev, buff, &down_new, &up_new);
162 163 if (!ret)
163   - goto end;
  164 + return -EINVAL;
164 165  
165 166 if (!down_new)
166 167 down_new = 1;
... ... @@ -184,7 +185,6 @@
184 185 atomic_set(&bat_priv->gw.bandwidth_up, up_new);
185 186 batadv_gw_tvlv_container_update(bat_priv);
186 187  
187   -end:
188 188 return count;
189 189 }
190 190