From: Ben Hutchings Date: Fri, 3 Mar 2017 02:32:07 +0000 (+0000) Subject: net/sock: Add sock_efree() function X-Git-Tag: v3.16.42~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f1a86023db8650682685a5845fea72c951c9852;p=thirdparty%2Fkernel%2Fstable.git net/sock: Add sock_efree() function Extracted from commit 62bccb8cdb69 ("net-timestamp: Make the clone operation stand-alone from phy timestamping"). Signed-off-by: Ben Hutchings --- diff --git a/include/net/sock.h b/include/net/sock.h index 07ede95596bbb..b67501ccbedf6 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -1569,6 +1569,7 @@ struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force, void sock_wfree(struct sk_buff *skb); void skb_orphan_partial(struct sk_buff *skb); void sock_rfree(struct sk_buff *skb); +void sock_efree(struct sk_buff *skb); void sock_edemux(struct sk_buff *skb); int sock_setsockopt(struct socket *sock, int level, int op, diff --git a/net/core/sock.c b/net/core/sock.c index 9cb00d1ea140d..1c2314fa672eb 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1678,6 +1678,12 @@ void sock_rfree(struct sk_buff *skb) } EXPORT_SYMBOL(sock_rfree); +void sock_efree(struct sk_buff *skb) +{ + sock_put(skb->sk); +} +EXPORT_SYMBOL(sock_efree); + void sock_edemux(struct sk_buff *skb) { struct sock *sk = skb->sk;