From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH net v2 03/03] [PATCH] vxlan: fix crash on module removal Date: Mon, 10 Jun 2013 13:13:15 -0700 Message-ID: <20130610131315.384c5b61@nehalam.linuxnetplumber.net> References: <20130610195822.888424947@vyatta.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, Stephen Hemminger To: davem@davemloft.net Return-path: Received: from mail-pa0-f49.google.com ([209.85.220.49]:65175 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751997Ab3FJUNY (ORCPT ); Mon, 10 Jun 2013 16:13:24 -0400 Received: by mail-pa0-f49.google.com with SMTP id ld11so1892788pab.8 for ; Mon, 10 Jun 2013 13:13:24 -0700 (PDT) In-Reply-To: <20130610195822.888424947@vyatta.com> Sender: netdev-owner@vger.kernel.org List-ID: If vxlan is removed with active vxlan's it would crash because rtnl_link_unregister (which calls vxlan_dellink), was invoked before unregister_pernet_device (which calls vxlan_stop). Signed-off-by: Stephen Hemminger --- Should goto stable --- a/drivers/net/vxlan.c 2013-06-06 08:29:07.910429205 -0700 +++ b/drivers/net/vxlan.c 2013-06-06 09:38:52.091675246 -0700 @@ -1785,8 +1785,9 @@ late_initcall(vxlan_init_module); static void __exit vxlan_cleanup_module(void) { - rtnl_link_unregister(&vxlan_link_ops); unregister_pernet_device(&vxlan_net_ops); + rtnl_link_unregister(&vxlan_link_ops); + destroy_workqueue(vxlan_wq); rcu_barrier(); } module_exit(vxlan_cleanup_module);