mac80211_hwsim: fix error return code in init_mac80211_hwsim()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 26 Aug 2013 07:32:58 +0000 (15:32 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 26 Aug 2013 07:52:58 +0000 (09:52 +0200)
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>
drivers/net/wireless/mac80211_hwsim.c

index a0d2aac..2cd3f54 100644 (file)
@@ -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();