[PATCH 5.18 096/231] net: marvell: prestera: fix missed deinit sequence

From: Greg Kroah-Hartman
Date: Tue Jul 19 2022 - 09:01:08 EST


From: Yevhen Orlov <yevhen.orlov@xxxxxxxxxxx>

[ Upstream commit f946964a9f79f8dcb5a6329265281eebfc23aee5 ]

Add unregister_fib_notifier as rollback of register_fib_notifier.

Fixes: 4394fbcb78cf ("net: marvell: prestera: handle fib notifications")
Signed-off-by: Yevhen Orlov <yevhen.orlov@xxxxxxxxxxx>
Link: https://lore.kernel.org/r/20220710122021.7642-1-yevhen.orlov@xxxxxxxxxxx
Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/net/ethernet/marvell/prestera/prestera_router.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/marvell/prestera/prestera_router.c b/drivers/net/ethernet/marvell/prestera/prestera_router.c
index 6c5618cf4f08..97d9012db189 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_router.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_router.c
@@ -587,6 +587,7 @@ int prestera_router_init(struct prestera_switch *sw)

void prestera_router_fini(struct prestera_switch *sw)
{
+ unregister_fib_notifier(&init_net, &sw->router->fib_nb);
unregister_inetaddr_notifier(&sw->router->inetaddr_nb);
unregister_inetaddr_validator_notifier(&sw->router->inetaddr_valid_nb);
rhashtable_destroy(&sw->router->kern_fib_cache_ht);
--
2.35.1