summaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorWei Yongjun2018-09-26 14:17:17 +0200
committerJohannes Berg2018-10-02 09:56:29 +0200
commit48f3b9e989725127e0edf1cc2f2e169094d03a43 (patch)
tree8aac0ebb6b97c01d933449df3e398bc27d798013 /net/mac80211/main.c
parentcfg80211: combine duplicate wdev init code (diff)
downloadkernel-qcow2-linux-48f3b9e989725127e0edf1cc2f2e169094d03a43.tar.gz
kernel-qcow2-linux-48f3b9e989725127e0edf1cc2f2e169094d03a43.tar.xz
kernel-qcow2-linux-48f3b9e989725127e0edf1cc2f2e169094d03a43.zip
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: 09b4a4faf9d0 ("mac80211: introduce capability flags for VHT EXT NSS support") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 77381017bac7..e6375d035355 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -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);