From: Vasily Averin Subject: [PATCH v2 07/21] fib_notifier: exit_net cleanup check added Date: Sun, 5 Nov 2017 19:50:08 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: netdev@vger.kernel.org Return-path: Received: from mailhub.sw.ru ([195.214.232.25]:27845 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751030AbdKEQuK (ORCPT ); Sun, 5 Nov 2017 11:50:10 -0500 Received: from [172.16.24.21] (msk-vpn.virtuozzo.com [195.214.232.6]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id vA5Go8Dq026253 for ; Sun, 5 Nov 2017 19:50:08 +0300 (MSK) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Be sure that fib_notifier_ops list initilized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/core/fib_notifier.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/core/fib_notifier.c b/net/core/fib_notifier.c index 4fc202d..1f57ec0 100644 --- a/net/core/fib_notifier.c +++ b/net/core/fib_notifier.c @@ -161,8 +161,15 @@ static int __net_init fib_notifier_net_init(struct net *net) return 0; } +static void __net_exit fib_notifier_net_exit(struct net *net) +{ + WARN(!list_empty(&net->fib_notifier_ops), + "%s: fib_notifier_ops list is not empty\n", __func__); +} + static struct pernet_operations fib_notifier_net_ops = { .init = fib_notifier_net_init, + .exit = fib_notifier_net_exit, }; static int __init fib_notifier_init(void) -- 2.7.4