Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a00c1d7c authored by Wei Yongjun's avatar Wei Yongjun Committed by Vidyullatha Kanchanapally
Browse files

cfg80211: fix possible memory leak in cfg80211_iter_combinations()



'limits' is malloced in cfg80211_iter_combinations() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: 0c317a02ca98 ("cfg80211: support virtual interfaces with
different beacon intervals")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>

Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git


Git-commit: 320c975f180b19296f0fd6c5bf2144e633aaba5e
CRs-fixed: 1025311
Change-Id: I3fd1ac7cc97a6161642bc5f00ca8b4edc4daa92b
Signed-off-by: default avatarPurushottam Kushwaha <pkushwah@codeaurora.org>
Signed-off-by: default avatarVidyullatha Kanchanapally <vidyullatha@codeaurora.org>
parent c6800ff6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1677,8 +1677,10 @@ int cfg80211_iter_combinations(struct wiphy *wiphy,

		if (params->beacon_int_gcd) {
			if (c->beacon_int_min_gcd &&
			    params->beacon_int_gcd < c->beacon_int_min_gcd)
			    params->beacon_int_gcd < c->beacon_int_min_gcd) {
				kfree(limits);
				return -EINVAL;
			}
			if (!c->beacon_int_min_gcd &&
			    params->beacon_int_different)
				goto cont;