Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp745591ybx; Wed, 30 Oct 2019 23:49:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpsJya5Aj5VHUwa+6luhFvqmMdZDFf4tTX1s/ptn/PcIi7sjyyBFCEc3TudTXg+l4BGkZJ X-Received: by 2002:a50:898a:: with SMTP id g10mr471347edg.191.1572504543468; Wed, 30 Oct 2019 23:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572504543; cv=none; d=google.com; s=arc-20160816; b=ZfwjDgiHAnEoOLYXxW+jN6jlE4aZ5Ga0AF6b4Q3nxWXlC2R9Si8xxFKfHrkeQ4NHZe KgBjWfyYvSnnNd9n6EhnPjYtOii3TAIE6aBBYU9TJRt6S576zPVEfF8BeDcmhS9E4x2B BjvcJ7QcHAJdrkSyjB3MOIJNUKCKGe8IoIYEPlZCwmdcyximzlflVEFeIka8MqbvS3op d4WYiIW/hVqghDNK0XARnpbc0d7ODMyuWyo0+KHlgnJPB7u2uMcrlf3vhJY0OUr7jzXe tH2EIZNoQsKogtYIRcig7ZvadQ1CIaCanM5onC2Q6zgkx8dZOCh78POPc2Ic4+IW1wo9 mfDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=bYHRackWGuPjQT1suHZ8e6zLfQgGLK8oL2f8LZsoY/8=; b=sBHBWgfiSS4mNhmmRcqETpQbRaJ8z1RY+VZLCRtiyftMuOZqZFwSDvTfj/onL+hrVg +3hLKFCMXGlOMsLvwgCd273OjupdC/N0NPLS+yBk7x4gQp3AYsgT2C/lRyiX0gXMZ4T7 EjrhQkyehVwyvn4ZVVqMVqDHpZJ4UZVIEOlIcFitP7lJf2xv6rv0lXixZiZI5/ZQ4h3E v2zcRG5Twt2EYdSP9PlGB/tLf/ai7k/N67zno2kbD7gCQKW531WJw8PFhxJw/UCbtIb8 5qXc02RhnYTwhbFLTyLyGiZUny2/nP09qFiEl1QoDC9GI06NLMaYBAf7EY4qPE265nnR pUCQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si2816305ejh.311.2019.10.30.23.48.39; Wed, 30 Oct 2019 23:49:03 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726490AbfJaGrw (ORCPT + 99 others); Thu, 31 Oct 2019 02:47:52 -0400 Received: from smtp10.smtpout.orange.fr ([80.12.242.132]:27139 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726479AbfJaGrw (ORCPT ); Thu, 31 Oct 2019 02:47:52 -0400 Received: from localhost.localdomain ([93.23.12.90]) by mwinf5d87 with ME id L6nn210011waAWt036nnoq; Thu, 31 Oct 2019 07:47:49 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 31 Oct 2019 07:47:49 +0100 X-ME-IP: 93.23.12.90 From: Christophe JAILLET To: davem@davemloft.net, sunilmut@microsoft.com, willemb@google.com, sgarzare@redhat.com, stefanha@redhat.com, ytht.net@gmail.com, arnd@arndb.de, tglx@linutronix.de, decui@microsoft.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] vsock: Simplify '__vsock_release()' Date: Thu, 31 Oct 2019 07:47:41 +0100 Message-Id: <20191031064741.4567-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) { -- 2.20.1