mac80211_hwsim: fix module init error paths for netlink
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 5 Oct 2018 20:22:06 +0000 (23:22 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Dec 2018 13:13:11 +0000 (14:13 +0100)
commit0d2d1629780025966c3fc793c201e387da18f5be
treee2a27aed6fae73d21b38c74a2d30b8c248086f3f
parent1f972505011c27d09423a46707789192a039b66a
mac80211_hwsim: fix module init error paths for netlink

[ Upstream commit 05cc09de4c017663a217630682041066f2f9a5cd ]

There is no unregister netlink notifier and family on error paths
in init_mac80211_hwsim(). Also there is an error path where
hwsim_class is not destroyed.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: 62759361eb49 ("mac80211-hwsim: Provide multicast event for HWSIM_CMD_NEW_RADIO")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mac80211_hwsim.c