netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] vsock: Simplify '__vsock_release()'
@ 2019-11-03  6:11 Christophe JAILLET
  2019-11-06  1:56 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2019-11-03  6:11 UTC (permalink / raw)
  To: davem, stefanha, ytht.net, sunilmut, willemb, arnd, tglx, decui
  Cc: netdev, linux-kernel, kernel-janitors, Christophe JAILLET,
	Stefano Garzarella

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>
---
V2: fix a typo in the commit message
    Add R-b tags
---
 net/vmw_vsock/af_vsock.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 2ab43b2bba31..2983dc92ca63 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -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) {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] vsock: Simplify '__vsock_release()'
  2019-11-03  6:11 [PATCH v2] vsock: Simplify '__vsock_release()' Christophe JAILLET
@ 2019-11-06  1:56 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-11-06  1:56 UTC (permalink / raw)
  To: christophe.jaillet
  Cc: stefanha, ytht.net, sunilmut, willemb, arnd, tglx, decui, netdev,
	linux-kernel, kernel-janitors, sgarzare

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Sun,  3 Nov 2019 07:11:11 +0100

> 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>

Applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-06  1:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-03  6:11 [PATCH v2] vsock: Simplify '__vsock_release()' Christophe JAILLET
2019-11-06  1:56 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).