]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: fix warning in function batadv_v_elp_get_throughput
authorAnders Roxell <anders.roxell@linaro.org>
Fri, 22 Feb 2019 15:25:54 +0000 (16:25 +0100)
committerSimon Wunderlich <sw@simonwunderlich.de>
Mon, 25 Mar 2019 08:31:19 +0000 (09:31 +0100)
commit694e61c1e586d8847cd08b00c89acdfebdf53683
treeeef3248d5c1f186aa83aa5865e88cfd2a37db73c
parentb2d85f82eeb1c14a3fb6e3a60827718fa49b2940
batman-adv: fix warning in function batadv_v_elp_get_throughput

When CONFIG_CFG80211 isn't enabled the compiler correcly warns about
'sinfo.pertid' may be unused. It can also happen for other error
conditions that it not warn about.

net/batman-adv/bat_v_elp.c: In function ‘batadv_v_elp_get_throughput.isra.0’:
include/net/cfg80211.h:6370:13: warning: ‘sinfo.pertid’ may be used
 uninitialized in this function [-Wmaybe-uninitialized]
  kfree(sinfo->pertid);
        ~~~~~^~~~~~~~

Rework so that we only release '&sinfo' if cfg80211_get_station returns
zero.

Fixes: 6c8edc708162 ("batman-adv: release station info tidstats")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/bat_v_elp.c