diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-08-26 15:32:58 +0800 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-08-26 09:52:58 +0200 |
commit | bcdd822007e44b1da1ad5a62f20b75ee7d8da608 (patch) | |
tree | 87200459f8587d7769aa0b42d89400698b4c9358 | |
parent | 19504cf5f35fbe85db811fce9f4392a0cbdada2f (diff) | |
download | linux-bcdd822007e44b1da1ad5a62f20b75ee7d8da608.tar.gz linux-bcdd822007e44b1da1ad5a62f20b75ee7d8da608.tar.bz2 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>
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 4 |
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(); |