File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -337,7 +337,10 @@ EXPORT_SYMBOL_GPL(vsock_find_connected_socket);
337337
338338void vsock_remove_sock (struct vsock_sock * vsk )
339339{
340- vsock_remove_bound (vsk );
340+ /* Transport reassignment must not remove the binding. */
341+ if (sock_flag (sk_vsock (vsk ), SOCK_DEAD ))
342+ vsock_remove_bound (vsk );
343+
341344 vsock_remove_connected (vsk );
342345}
343346EXPORT_SYMBOL_GPL (vsock_remove_sock );
@@ -821,12 +824,13 @@ static void __vsock_release(struct sock *sk, int level)
821824 */
822825 lock_sock_nested (sk , level );
823826
827+ sock_orphan (sk );
828+
824829 if (vsk -> transport )
825830 vsk -> transport -> release (vsk );
826831 else if (sock_type_connectible (sk -> sk_type ))
827832 vsock_remove_sock (vsk );
828833
829- sock_orphan (sk );
830834 sk -> sk_shutdown = SHUTDOWN_MASK ;
831835
832836 skb_queue_purge (& sk -> sk_receive_queue );
You can’t perform that action at this time.
0 commit comments