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 @@ -333,7 +333,10 @@ EXPORT_SYMBOL_GPL(vsock_find_connected_socket);
333
333
334
334
void vsock_remove_sock (struct vsock_sock * vsk )
335
335
{
336
- vsock_remove_bound (vsk );
336
+ /* Transport reassignment must not remove the binding. */
337
+ if (sock_flag (sk_vsock (vsk ), SOCK_DEAD ))
338
+ vsock_remove_bound (vsk );
339
+
337
340
vsock_remove_connected (vsk );
338
341
}
339
342
EXPORT_SYMBOL_GPL (vsock_remove_sock );
@@ -818,12 +821,13 @@ static void __vsock_release(struct sock *sk, int level)
818
821
*/
819
822
lock_sock_nested (sk , level );
820
823
824
+ sock_orphan (sk );
825
+
821
826
if (vsk -> transport )
822
827
vsk -> transport -> release (vsk );
823
828
else if (sock_type_connectible (sk -> sk_type ))
824
829
vsock_remove_sock (vsk );
825
830
826
- sock_orphan (sk );
827
831
sk -> sk_shutdown = SHUTDOWN_MASK ;
828
832
829
833
skb_queue_purge (& sk -> sk_receive_queue );
You can’t perform that action at this time.
0 commit comments