mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
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: 0c317a02ca ("cfg80211: support virtual interfaces with different beacon intervals")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
a3e2f4b6ed
commit
320c975f18
1 changed files with 3 additions and 1 deletions
|
|
@ -1676,8 +1676,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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue