From: Sven Eckelmann Date: Sun, 21 Jun 2015 12:42:49 +0000 (+0200) Subject: batman-adv: Return EINVAL on invalid gw_bandwidth change X-Git-Tag: firefly_0821_release~176^2~1159^2~82^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=77927b7d9dd6c9c5f59f0f49c76cda54b908090e;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Marek Lindner Signed-off-by: Antonio Quartulli --- diff --git a/net/batman-adv/gateway_common.c b/net/batman-adv/gateway_common.c index c50931cbfbb5..6b930a651f38 100644 --- a/net/batman-adv/gateway_common.c +++ b/net/batman-adv/gateway_common.c @@ -19,6 +19,7 @@ #include "main.h" #include +#include #include #include #include @@ -160,7 +161,7 @@ ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff, ret = batadv_parse_gw_bandwidth(net_dev, buff, &down_new, &up_new); if (!ret) - goto end; + return -EINVAL; if (!down_new) down_new = 1; @@ -184,7 +185,6 @@ ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff, atomic_set(&bat_priv->gw.bandwidth_up, up_new); batadv_gw_tvlv_container_update(bat_priv); -end: return count; }