summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mac80211_hwsim.c
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-08-26 09:32:58 +0200
committerJohannes Berg <johannes.berg@intel.com>2013-08-26 09:52:58 +0200
commitbcdd822007e44b1da1ad5a62f20b75ee7d8da608 (patch)
tree87200459f8587d7769aa0b42d89400698b4c9358 /drivers/net/wireless/mac80211_hwsim.c
parentcfg80211: add flags to cfg80211_rx_mgmt() (diff)
downloadlinux-bcdd822007e44b1da1ad5a62f20b75ee7d8da608.tar.xz
linux-bcdd822007e44b1da1ad5a62f20b75ee7d8da608.zip
mac80211_hwsim: fix error return code in init_mac80211_hwsim()
Fix to return -ENOMEM in the netdev alloc error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index a0d2aacd5e09..2cd3f54e1efa 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2528,8 +2528,10 @@ static int __init init_mac80211_hwsim(void)
}
hwsim_mon = alloc_netdev(0, "hwsim%d", hwsim_mon_setup);
- if (hwsim_mon == NULL)
+ if (hwsim_mon == NULL) {
+ err = -ENOMEM;
goto failed;
+ }
rtnl_lock();