Skip to content

Commit

Permalink
vsock: Simplify '__vsock_release()'
Browse files Browse the repository at this point in the history
Use 'skb_queue_purge()' instead of re-implementing it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Christophe JAILLET authored and David S. Miller committed Nov 6, 2019
1 parent c058f6d commit 3b7ad08
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/vmw_vsock/af_vsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,6 @@ EXPORT_SYMBOL_GPL(__vsock_create);
static void __vsock_release(struct sock *sk, int level)
{
if (sk) {
struct sk_buff *skb;
struct sock *pending;
struct vsock_sock *vsk;

Expand All @@ -662,8 +661,7 @@ static void __vsock_release(struct sock *sk, int level)
sock_orphan(sk);
sk->sk_shutdown = SHUTDOWN_MASK;

while ((skb = skb_dequeue(&sk->sk_receive_queue)))
kfree_skb(skb);
skb_queue_purge(&sk->sk_receive_queue);

/* Clean up any sockets that never were accepted. */
while ((pending = vsock_dequeue_accept(sk)) != NULL) {
Expand Down

0 comments on commit 3b7ad08

Please sign in to comment.