mac80211: fix memory leak
authorSudip Mukherjee <sudip@vectorindia.org>
Tue, 2 Feb 2016 07:51:14 +0000 (13:21 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 24 Feb 2016 08:04:32 +0000 (09:04 +0100)
On error we jumped to the error label and returned the error code but we
missed releasing sinfo.

Fixes: 5fe74014172d ("mac80211: avoid excessive stack usage in sta_info")
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/sta_info.c

index 5894c0a1c01ff64afe28d2fbaaf793344603a2b7..87b7e7a7df6cc22a8aced080e86c765308ca9a0b 100644 (file)
@@ -562,6 +562,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
        __cleanup_single_sta(sta);
  out_err:
        mutex_unlock(&local->sta_mtx);
+       kfree(sinfo);
        rcu_read_lock();
        return err;
 }