public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] appletalk: Set skb with destructor
@ 2014-07-05  4:28 Andrey Utkin
  2014-07-05 20:28 ` Dan Carpenter
  0 siblings, 1 reply; 10+ messages in thread
From: Andrey Utkin @ 2014-07-05  4:28 UTC (permalink / raw)
  To: linux-kernel, kernel-janitors, acme; +Cc: Andrey Utkin

See https://bugzilla.kernel.org/show_bug.cgi?id=79441
---8<---
Made changes similar to 0ae89beb283a0db5980d1d4781c7d7be2f2810d6

Reported-by: Ed Martin <edman007@edman007.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
---
 net/appletalk/ddp.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 01a1082..3d8ab34 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -1399,6 +1399,11 @@ drop:
 	return NET_RX_DROP;
 }
 
+static inline void atalk_skb_destructor(struct sk_buff *skb)
+{
+	sock_put(skb->sk);
+}
+
 /**
  *	atalk_rcv - Receive a packet (in skb) from device dev
  *	@skb - packet received
@@ -1489,6 +1494,8 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
 		goto drop;
 
 	/* Queue packet (standard) */
+	sock_hold(sock);
+	skb->destructor = atalk_skb_destructor;
 	skb->sk = sock;
 
 	if (sock_queue_rcv_skb(sock, skb) < 0)
@@ -1644,6 +1651,8 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
 	if (!skb)
 		goto out;
 
+	sock_hold(sk);
+	skb->destructor = atalk_skb_destructor;
 	skb->sk = sk;
 	skb_reserve(skb, ddp_dl->header_length);
 	skb_reserve(skb, dev->hard_header_len);
-- 
1.8.3.2


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

end of thread, other threads:[~2014-07-07 18:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-05  4:28 [PATCH] appletalk: Set skb with destructor Andrey Utkin
2014-07-05 20:28 ` Dan Carpenter
2014-07-06 11:56   ` Andrey Utkin
2014-07-06 21:42     ` Eric Dumazet
2014-07-07  8:03       ` Andrey Utkin
2014-07-07  8:57         ` Eric Dumazet
2014-07-07  9:26           ` Eric Dumazet
2014-07-07 10:02             ` Andrey Utkin
2014-07-07 16:56               ` Eric Dumazet
2014-07-07 18:57                 ` Andrey Utkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox