diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-09-26 12:17:17 +0000 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-10-02 09:56:29 +0200 |
commit | 48f3b9e989725127e0edf1cc2f2e169094d03a43 (patch) | |
tree | 8aac0ebb6b97c01d933449df3e398bc27d798013 /net/mac80211/main.c | |
parent | e4d4216e91ea31049ba0cde0799ece244410a9f7 (diff) | |
download | linux-stable-48f3b9e989725127e0edf1cc2f2e169094d03a43.tar.gz linux-stable-48f3b9e989725127e0edf1cc2f2e169094d03a43.tar.bz2 linux-stable-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.c | 4 |
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); |