mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-11-17 15:14:35 +08:00
mac80211: fix memory leak in device registration error path
If the cipher suites need to be allocated, but this allocation fails, this leaks the internal scan request. Fix that by going to the correct error handling label. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
987c285c2a
commit
cfff2f999d
@ -871,8 +871,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
|
||||
local->hw.wiphy->cipher_suites,
|
||||
sizeof(u32) * local->hw.wiphy->n_cipher_suites,
|
||||
GFP_KERNEL);
|
||||
if (!suites)
|
||||
return -ENOMEM;
|
||||
if (!suites) {
|
||||
result = -ENOMEM;
|
||||
goto fail_wiphy_register;
|
||||
}
|
||||
for (r = 0; r < local->hw.wiphy->n_cipher_suites; r++) {
|
||||
u32 suite = local->hw.wiphy->cipher_suites[r];
|
||||
if (suite == WLAN_CIPHER_SUITE_WEP40 ||
|
||||
|
Loading…
Reference in New Issue
Block a user