mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
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>
This commit is contained in:
committed by
David S. Miller
parent
b1bba80a43
commit
6a2c096210
@@ -462,6 +462,8 @@ static void virtio_vsock_rx_done(struct virtqueue *vq)
|
||||
|
||||
static struct virtio_transport virtio_transport = {
|
||||
.transport = {
|
||||
.module = THIS_MODULE,
|
||||
|
||||
.get_local_cid = virtio_transport_get_local_cid,
|
||||
|
||||
.init = virtio_transport_do_socket_init,
|
||||
|
||||
Reference in New Issue
Block a user