]> git.baikalelectronics.ru Git - kernel.git/commit
VSOCK: make af_vsock.ko removable again
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 17 Apr 2018 06:25:58 +0000 (14:25 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Apr 2018 13:44:30 +0000 (09:44 -0400)
commit529cf37c6106c27d9955fb0bb28c249df106f580
tree20855a057bab049eaefaf19916d4ebf38ba288f8
parentbd270ade3e1a59217d8bb0e0a69e496902b53a76
VSOCK: make af_vsock.ko removable again

Commit 3fcb916cc5f27fe8ec363a4179afbee0eb3666e9 ("vsock: always call
vsock_init_tables()") introduced a module_init() function without a
corresponding module_exit() function.

Modules with an init function can only be removed if they also have an
exit function.  Therefore the vsock module was considered "permanent"
and could not be removed.

This patch adds an empty module_exit() function so that "rmmod vsock"
works.  No explicit cleanup is required because:

1. Transports call vsock_core_exit() upon exit and cannot be removed
   while sockets are still alive.
2. vsock_diag.ko does not perform any action that requires cleanup by
   vsock.ko.

Fixes: 3fcb916cc5f2 ("vsock: always call vsock_init_tables()")
Reported-by: Xiumei Mu <xmu@redhat.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/vmw_vsock/af_vsock.c