From: Su Kang Yin Date: Fri, 7 Aug 2015 08:54:10 +0000 (+0800) Subject: mac80211_hwsim: unregister genetlink family properly X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2459cd876e2828dc63c19ea5dadf8a94a8f11244;p=linux-beck.git mac80211_hwsim: unregister genetlink family properly During hwsim_init_netlink(), we should call genl_unregister_family() if failed on netlink_register_notifier() since the genetlink is already registered. Signed-off-by: Su Kang Yin Signed-off-by: Johannes Berg --- diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 08022ded6307..dbb46ece6f52 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -3121,8 +3121,10 @@ static int hwsim_init_netlink(void) goto failure; rc = netlink_register_notifier(&hwsim_netlink_notifier); - if (rc) + if (rc) { + genl_unregister_family(&hwsim_genl_family); goto failure; + } return 0;