diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/ip6_flowlabel.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index 29124b7a04c8..5d767f1b8780 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c | |||
@@ -255,10 +255,19 @@ void fl6_free_socklist(struct sock *sk) | |||
255 | struct ipv6_pinfo *np = inet6_sk(sk); | 255 | struct ipv6_pinfo *np = inet6_sk(sk); |
256 | struct ipv6_fl_socklist *sfl; | 256 | struct ipv6_fl_socklist *sfl; |
257 | 257 | ||
258 | while ((sfl = np->ipv6_fl_list) != NULL) { | 258 | if (!np->ipv6_fl_list) |
259 | np->ipv6_fl_list = sfl->next; | 259 | return; |
260 | |||
261 | write_lock_bh(&ipv6_sk_fl_lock); | ||
262 | sfl = np->ipv6_fl_list; | ||
263 | np->ipv6_fl_list = NULL; | ||
264 | write_unlock_bh(&ipv6_sk_fl_lock); | ||
265 | |||
266 | while (sfl) { | ||
267 | struct ipv6_fl_socklist *next = sfl->next; | ||
260 | fl_release(sfl->fl); | 268 | fl_release(sfl->fl); |
261 | kfree(sfl); | 269 | kfree(sfl); |
270 | sfl = next; | ||
262 | } | 271 | } |
263 | } | 272 | } |
264 | 273 | ||