Re: [PATCH net] openvswitch: properly refcount vport-vxlan module
From: David Miller <davem@davemloft.net>
Date: 2015-11-30 03:56:04
From: David Miller <davem@davemloft.net>
Date: 2015-11-30 03:56:04
From: Paolo Abeni <pabeni@redhat.com> Date: Wed, 25 Nov 2015 18:05:27 +0100
After 614732eaa12d, no refcount is mainteined for the vport-vxlan module.
This allows the userspace to remove such module while vport-vxlan
devices still exist, which lead to later oops, i.e. when
the openvswitch module is removed.
Fixes: 614732eaa12d ("openvswitch: Use regular VXLAN net_device device")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>This is so error prone, with some vport_ops needing to mark the module and some don't (because they are in the main openvswitch driver). Fix this properly, by making the vport_ops register function be a macro that sets THIS_MODULE in the vport_ops before passing it on down to the real registry function.