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);
337
337
338
338
void vsock_remove_sock (struct vsock_sock * vsk )
339
339
{
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
+
341
344
vsock_remove_connected (vsk );
342
345
}
343
346
EXPORT_SYMBOL_GPL (vsock_remove_sock );
@@ -821,12 +824,13 @@ static void __vsock_release(struct sock *sk, int level)
821
824
*/
822
825
lock_sock_nested (sk , level );
823
826
827
+ sock_orphan (sk );
828
+
824
829
if (vsk -> transport )
825
830
vsk -> transport -> release (vsk );
826
831
else if (sock_type_connectible (sk -> sk_type ))
827
832
vsock_remove_sock (vsk );
828
833
829
- sock_orphan (sk );
830
834
sk -> sk_shutdown = SHUTDOWN_MASK ;
831
835
832
836
skb_queue_purge (& sk -> sk_receive_queue );
You can’t perform that action at this time.
0 commit comments