[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240813093914.501183-1-jchapman@katalix.com>
Date: Tue, 13 Aug 2024 10:39:14 +0100
From: James Chapman <jchapman@...alix.com>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
dsahern@...nel.org,
tparkin@...alix.com,
xiyou.wangcong@...il.com
Subject: [PATCH net-next] l2tp: use skb_queue_purge in l2tp_ip_destroy_sock
Recent commit ed8ebee6def7 ("l2tp: have l2tp_ip_destroy_sock use
ip_flush_pending_frames") was incorrect in that l2tp_ip does not use
socket cork and ip_flush_pending_frames is for sockets that do. Use
skb_queue_purge instead and remove the unnecessary lock.
Suggested-by: xiyou.wangcong@...il.com
Signed-off-by: James Chapman <jchapman@...alix.com>
Signed-off-by: Tom Parkin <tparkin@...alix.com>
---
net/l2tp/l2tp_ip.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
index 39f3f1334c4a..ad659f4315df 100644
--- a/net/l2tp/l2tp_ip.c
+++ b/net/l2tp/l2tp_ip.c
@@ -258,9 +258,7 @@ static void l2tp_ip_destroy_sock(struct sock *sk)
{
struct l2tp_tunnel *tunnel;
- lock_sock(sk);
- ip_flush_pending_frames(sk);
- release_sock(sk);
+ skb_queue_purge(&sk->sk_write_queue);
tunnel = l2tp_sk_to_tunnel(sk);
if (tunnel) {
--
2.34.1
Powered by blists - more mailing lists