mac80211_hwsim: unregister genetlink family properly
authorSu Kang Yin <cantona@cantona.net>
Fri, 7 Aug 2015 08:54:10 +0000 (16:54 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 14 Aug 2015 15:49:52 +0000 (17:49 +0200)
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 <cantona@cantona.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/mac80211_hwsim.c

index 08022ded630712b434b4d815c7c2d9bcb1029430..dbb46ece6f5246b948c8c0cdff3ab40b4719a2b4 100644 (file)
@@ -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;