Patchwork pptp: fix skb leak in pptp_xmit()

login
register
mail settings
Submitter Eric Dumazet
Date Oct. 18, 2011, 3:01 a.m.
Message ID <1318906907.2571.39.camel@edumazet-laptop>
Download mbox | patch
Permalink /patch/120361/
State Accepted
Delegated to: David Miller
Headers show

Comments

Eric Dumazet - Oct. 18, 2011, 3:01 a.m.
In case we cant transmit skb, we must free it

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Dmitry Kozlov <xeb@mail.ru>
---
 drivers/net/pptp.c |    2 ++
 1 file changed, 2 insertions(+)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Oct. 19, 2011, 6:39 a.m.
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 18 Oct 2011 05:01:47 +0200

> In case we cant transmit skb, we must free it
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Dmitry Kozlov <xeb@mail.ru>

Applied, thanks Eric.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/pptp.c b/drivers/net/pptp.c
index eae542a..9c0403d 100644
--- a/drivers/net/pptp.c
+++ b/drivers/net/pptp.c
@@ -285,8 +285,10 @@  static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
 	ip_send_check(iph);
 
 	ip_local_out(skb);
+	return 1;
 
 tx_error:
+	kfree_skb(skb);
 	return 1;
 }