aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/pppol2tp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
index 8db342f2fdc9..04c7e5b407fd 100644
--- a/drivers/net/pppol2tp.c
+++ b/drivers/net/pppol2tp.c
@@ -1279,6 +1279,7 @@ out:
1279static int pppol2tp_release(struct socket *sock) 1279static int pppol2tp_release(struct socket *sock)
1280{ 1280{
1281 struct sock *sk = sock->sk; 1281 struct sock *sk = sock->sk;
1282 struct pppol2tp_session *session;
1282 int error; 1283 int error;
1283 1284
1284 if (!sk) 1285 if (!sk)
@@ -1296,9 +1297,18 @@ static int pppol2tp_release(struct socket *sock)
1296 sock_orphan(sk); 1297 sock_orphan(sk);
1297 sock->sk = NULL; 1298 sock->sk = NULL;
1298 1299
1300 session = pppol2tp_sock_to_session(sk);
1301
1299 /* Purge any queued data */ 1302 /* Purge any queued data */
1300 skb_queue_purge(&sk->sk_receive_queue); 1303 skb_queue_purge(&sk->sk_receive_queue);
1301 skb_queue_purge(&sk->sk_write_queue); 1304 skb_queue_purge(&sk->sk_write_queue);
1305 if (session != NULL) {
1306 struct sk_buff *skb;
1307 while ((skb = skb_dequeue(&session->reorder_q))) {
1308 kfree_skb(skb);
1309 sock_put(sk);
1310 }
1311 }
1302 1312
1303 release_sock(sk); 1313 release_sock(sk);
1304 1314