Skip to content

Commit

Permalink
mac80211_hwsim: unregister genetlink family properly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Su Kang Yin authored and Johannes Berg committed Aug 14, 2015
1 parent b119ad6 commit 2459cd8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2459cd8

Please sign in to comment.