Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp869727ybx; Thu, 31 Oct 2019 02:08:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4F+ivfsTpbzggOlx8hcui3aCEZM1Z2xgb8uF3+jaSYVZKV8O74ClvqmaOl1PGPfzj8i8P X-Received: by 2002:a17:906:5494:: with SMTP id r20mr2617508ejo.293.1572512894711; Thu, 31 Oct 2019 02:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572512894; cv=none; d=google.com; s=arc-20160816; b=wkC+X6uw/zddUPwDHxe8BGdmSeohmVgp2BjpIrQPLo/8DAafXxkRYxG+ThxmeSAD3s br6Fnk/wEgpin/KCi/sHLCq94ljTi0T7/jjohCWYV0cuaqZjBMtga4V18qtZ40JqIBpF A/69YcxqmVx58ezEZo7y8oH+dIQoNtUbqzv1gkfc1DNtFTkBqYxsiCG2sWWu6AdlC1KL xM4OyuVjL0M8Kw74Ga1qMzSr5yJ7eWJ26SpXyaOB9bAaCr7xxZM33ZN85jPMnxtbh8OG 8+t3j4b36HPdfsGSy4XQsiOXXsq9gTYc5vDO/Zw1Ia+dYTikC/XqHafDRkqAUI5AonZQ qZQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Uv8J8WDWlm5KkI7ZZB1632xd20pA70gOpFtg9sDlJvM=; b=dIb+gYQbZG1UR/8fD7FjgsUQ6Nnb5Cxa1xvQ4zgDx3zutmeXRNHd/jpNvHQpyJ4jBE Ll/uypjIcUsiDWXr/1LZ0KFMxZe3PqhBiwioK65Z53rxoQ15lfZ/x1zmqL71cRuhzAST ZxrU7jXznlcsZWDBSXUDRwNFX3Mq4kJrwjjfnaeiIGgFW1orCcdYMe+ForR70vbTQQRM ZBh6SbPmGRZnWwq/QH3IBtV3UUlanc3uGz2QXbkInQsOLElwWBvrToThqR4qtoG/5cWa dnWQN63zhwcobxNuKkufDHm4ZEhWswhYooEL0T54+/t994PaDvCvGqBYCiC98DQv+oXI ve/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si2947188ejx.348.2019.10.31.02.07.50; Thu, 31 Oct 2019 02:08:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726892AbfJaJHM (ORCPT + 99 others); Thu, 31 Oct 2019 05:07:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37042 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726864AbfJaJHL (ORCPT ); Thu, 31 Oct 2019 05:07:11 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84BC25945B for ; Thu, 31 Oct 2019 09:07:11 +0000 (UTC) Received: by mail-wr1-f71.google.com with SMTP id k10so2889409wrl.22 for ; Thu, 31 Oct 2019 02:07:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Uv8J8WDWlm5KkI7ZZB1632xd20pA70gOpFtg9sDlJvM=; b=bFQoyIP+3H64fcp3Q8gGN1DilcNdHg/ELt7Qh0N7fZKZ8W9eat7Wly0DlzxGLcV/jn OqLZ0BJR7vqtSsz6bcYuThfyQ6NapLyEJvkHluVC8rJRgFuRyonhWKyT5HC4T1IXFscZ 6tDLwqWeXZJWr9YSRcwQ4KUgLwONVGYtaDSnFhSMg9rF3z3hAcO/JPO0h1Xdk3uJsRhg 7SJgpQJ15SGc33RggVeaC2L4pmOvFnTsZBR8rsaJJejsT8dIfwBKu7e54L3sQAYZDgWe jAAEQNNcJkDjOkEIASp+BqXIVATnN9s19wutrp4HHb28STvO2zQR5ZotrgSI4kKCHsfc k83A== X-Gm-Message-State: APjAAAUY5yvuhxXuQwrfxltfsCZQrLOY0XWCFq9j42puGxkcaAGx9zdW VH4FoN6pbpp3ZMyl6RHAeC22Pq3ofB+EkW20rL3gNb52ujZ2A9FNvnvSPz1rhb7m6c234g5p0Om jixmmMrP6VjoPE5zQwDUCN4NH X-Received: by 2002:a1c:6308:: with SMTP id x8mr4076651wmb.140.1572512830195; Thu, 31 Oct 2019 02:07:10 -0700 (PDT) X-Received: by 2002:a1c:6308:: with SMTP id x8mr4076626wmb.140.1572512829951; Thu, 31 Oct 2019 02:07:09 -0700 (PDT) Received: from steredhat ([91.217.168.176]) by smtp.gmail.com with ESMTPSA id x205sm3535236wmb.5.2019.10.31.02.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2019 02:07:09 -0700 (PDT) Date: Thu, 31 Oct 2019 10:07:07 +0100 From: Stefano Garzarella To: Christophe JAILLET 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()' Message-ID: <20191031090707.ec33h3z6zhux3hbq@steredhat> References: <20191031064741.4567-1-christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191031064741.4567-1-christophe.jaillet@wanadoo.fr> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 Thanks, Stefano