提交 bcdd8220 编写于 作者: W Wei Yongjun 提交者: Johannes Berg

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: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 19504cf5
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册