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

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);