mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 10:26:09 +00:00
vsock: Simplify '__vsock_release()'
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>
This commit is contained in:
parent
c058f6dfeb
commit
3b7ad08b51
@ -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;
|
||||
|
||||
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user