Browse Source

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>
Wei Yongjun 12 years ago
parent
commit
bcdd822007
1 changed files with 3 additions and 1 deletions
  1. 3 1
      drivers/net/wireless/mac80211_hwsim.c

+ 3 - 1
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();