netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC net-next 1/4] ipv6 flowlabel: Ensure to take lock when modifying np->ip6_sk_fl_list.
@ 2013-01-30 19:26 YOSHIFUJI Hideaki
  2013-01-31  3:41 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: YOSHIFUJI Hideaki @ 2013-01-30 19:26 UTC (permalink / raw)
  To: davem, netdev; +Cc: yoshfuji

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
 net/ipv6/ip6_flowlabel.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 29124b7..5d767f1 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -255,10 +255,19 @@ void fl6_free_socklist(struct sock *sk)
 	struct ipv6_pinfo *np = inet6_sk(sk);
 	struct ipv6_fl_socklist *sfl;
 
-	while ((sfl = np->ipv6_fl_list) != NULL) {
-		np->ipv6_fl_list = sfl->next;
+	if (!np->ipv6_fl_list)
+		return;
+
+	write_lock_bh(&ipv6_sk_fl_lock);
+	sfl = np->ipv6_fl_list;
+	np->ipv6_fl_list = NULL;
+	write_unlock_bh(&ipv6_sk_fl_lock);
+
+	while (sfl) {
+		struct ipv6_fl_socklist *next = sfl->next;
 		fl_release(sfl->fl);
 		kfree(sfl);
+		sfl = next;
 	}
 }
 
-- 
1.7.9.5

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

* Re: [RFC net-next 1/4] ipv6 flowlabel: Ensure to take lock when modifying np->ip6_sk_fl_list.
  2013-01-30 19:26 [RFC net-next 1/4] ipv6 flowlabel: Ensure to take lock when modifying np->ip6_sk_fl_list YOSHIFUJI Hideaki
@ 2013-01-31  3:41 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-01-31  3:41 UTC (permalink / raw)
  To: yoshfuji; +Cc: netdev

From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Thu, 31 Jan 2013 04:26:42 +0900

> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

Applied.

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

end of thread, other threads:[~2013-01-31  3:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-30 19:26 [RFC net-next 1/4] ipv6 flowlabel: Ensure to take lock when modifying np->ip6_sk_fl_list YOSHIFUJI Hideaki
2013-01-31  3:41 ` 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).