From: Wei Yongjun Date: Wed, 26 Sep 2018 12:17:17 +0000 (+0000) Subject: mac80211: fix error handling in ieee80211_register_hw() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=48f3b9e989725127e0edf1cc2f2e169094d03a43;p=linux.git 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 Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 77381017bac77..e6375d035355f 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);