From: Stefano Garzarella <sgarzare@redhat.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: davem@davemloft.net, sunilmut@microsoft.com, willemb@google.com,
stefanha@redhat.com, ytht.net@gmail.com, arnd@arndb.de,
tglx@linutronix.de, decui@microsoft.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] vsock: Simplify '__vsock_release()'
Date: Thu, 31 Oct 2019 10:07:07 +0100 [thread overview]
Message-ID: <20191031090707.ec33h3z6zhux3hbq@steredhat> (raw)
In-Reply-To: <20191031064741.4567-1-christophe.jaillet@wanadoo.fr>
On Thu, Oct 31, 2019 at 07:47:41AM +0100, Christophe JAILLET wrote:
> Use '__skb_queue_purge()' instead of re-implementing it.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> 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) {
Good clean-up!
This patch LGTM:
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Thanks,
Stefano
WARNING: multiple messages have this Message-ID (diff)
From: Stefano Garzarella <sgarzare@redhat.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: davem@davemloft.net, sunilmut@microsoft.com, willemb@google.com,
stefanha@redhat.com, ytht.net@gmail.com, arnd@arndb.de,
tglx@linutronix.de, decui@microsoft.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] vsock: Simplify '__vsock_release()'
Date: Thu, 31 Oct 2019 09:07:07 +0000 [thread overview]
Message-ID: <20191031090707.ec33h3z6zhux3hbq@steredhat> (raw)
In-Reply-To: <20191031064741.4567-1-christophe.jaillet@wanadoo.fr>
On Thu, Oct 31, 2019 at 07:47:41AM +0100, Christophe JAILLET wrote:
> Use '__skb_queue_purge()' instead of re-implementing it.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> 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) {
Good clean-up!
This patch LGTM:
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Thanks,
Stefano
next prev parent reply other threads:[~2019-10-31 9:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-31 6:47 [PATCH] vsock: Simplify '__vsock_release()' Christophe JAILLET
2019-10-31 6:47 ` Christophe JAILLET
2019-10-31 9:07 ` Stefano Garzarella [this message]
2019-10-31 9:07 ` Stefano Garzarella
2019-10-31 9:36 ` Sergei Shtylyov
2019-10-31 9:36 ` Sergei Shtylyov
2019-10-31 9:48 ` Christophe JAILLET
2019-10-31 9:48 ` Christophe JAILLET
2019-11-02 17:11 ` Stefano Garzarella
2019-11-02 17:11 ` Stefano Garzarella
2019-11-01 8:08 ` Stefan Hajnoczi
2019-11-01 8:08 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191031090707.ec33h3z6zhux3hbq@steredhat \
--to=sgarzare@redhat.com \
--cc=arnd@arndb.de \
--cc=christophe.jaillet@wanadoo.fr \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stefanha@redhat.com \
--cc=sunilmut@microsoft.com \
--cc=tglx@linutronix.de \
--cc=willemb@google.com \
--cc=ytht.net@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.