Commit 48f3b9e9 authored by Wei Yongjun's avatar Wei Yongjun Committed by Johannes Berg

mac80211: fix error handling in ieee80211_register_hw()

Fix to return a negative error code -ENOMEM from the kmemdup
error handling case instead of 0.

Fixes: 09b4a4fa ("mac80211: introduce capability flags for VHT EXT NSS support")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent e4d4216e
......@@ -1203,8 +1203,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
continue;
sband = kmemdup(sband, sizeof(*sband), GFP_KERNEL);
if (!sband)
if (!sband) {
result = -ENOMEM;
goto fail_rate;
}
wiphy_dbg(hw->wiphy, "copying sband (band %d) due to VHT EXT NSS BW flag\n",
band);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment