Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 19504cf5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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();