Commit 3b7ad08b authored by Christophe JAILLET's avatar Christophe JAILLET Committed by David S. Miller

vsock: Simplify '__vsock_release()'

Use 'skb_queue_purge()' instead of re-implementing it.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c058f6df
...@@ -641,7 +641,6 @@ EXPORT_SYMBOL_GPL(__vsock_create); ...@@ -641,7 +641,6 @@ EXPORT_SYMBOL_GPL(__vsock_create);
static void __vsock_release(struct sock *sk, int level) static void __vsock_release(struct sock *sk, int level)
{ {
if (sk) { if (sk) {
struct sk_buff *skb;
struct sock *pending; struct sock *pending;
struct vsock_sock *vsk; struct vsock_sock *vsk;
...@@ -662,8 +661,7 @@ static void __vsock_release(struct sock *sk, int level) ...@@ -662,8 +661,7 @@ static void __vsock_release(struct sock *sk, int level)
sock_orphan(sk); sock_orphan(sk);
sk->sk_shutdown = SHUTDOWN_MASK; sk->sk_shutdown = SHUTDOWN_MASK;
while ((skb = skb_dequeue(&sk->sk_receive_queue))) skb_queue_purge(&sk->sk_receive_queue);
kfree_skb(skb);
/* Clean up any sockets that never were accepted. */ /* Clean up any sockets that never were accepted. */
while ((pending = vsock_dequeue_accept(sk)) != NULL) { while ((pending = vsock_dequeue_accept(sk)) != NULL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment