diff options
author | Stefano Garzarella <sgarzare@redhat.com> | 2019-11-14 10:57:48 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-14 18:12:18 -0800 |
commit | 6a2c0962105ae8ceba182c4f616e0e41d7755591 (patch) | |
tree | eddaccb735a16b747cb7e422c93d2319233e91ba /net/vmw_vsock/vmci_transport.c | |
parent | b1bba80a4376aef34de2b57bfb8834bd095703ed (diff) | |
download | lwn-6a2c0962105ae8ceba182c4f616e0e41d7755591.tar.gz lwn-6a2c0962105ae8ceba182c4f616e0e41d7755591.zip |
vsock: prevent transport modules unloading
This patch adds 'module' member in the 'struct vsock_transport'
in order to get/put the transport module. This prevents the
module unloading while sockets are assigned to it.
We increase the module refcnt when a socket is assigned to a
transport, and we decrease the module refcnt when the socket
is destructed.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/vmw_vsock/vmci_transport.c')
-rw-r--r-- | net/vmw_vsock/vmci_transport.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index d9c9c834ad6f..644d32e43d23 100644 --- a/net/vmw_vsock/vmci_transport.c +++ b/net/vmw_vsock/vmci_transport.c @@ -2020,6 +2020,7 @@ static u32 vmci_transport_get_local_cid(void) } static struct vsock_transport vmci_transport = { + .module = THIS_MODULE, .init = vmci_transport_socket_init, .destruct = vmci_transport_destruct, .release = vmci_transport_release, |