diff options
author | Olof Johansson <olof@lixom.net> | 2012-09-21 23:00:41 -0700 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-09-21 23:00:41 -0700 |
commit | 8437de04d1475ee4af43a217ac2ca74eb9f58ad1 (patch) | |
tree | b8481a64ea0bcb0a6b2f8d27f0c26e39726f0a03 /net/sctp/output.c | |
parent | 3aec092eed5d8d2b19a62b0aeed3acea9471099a (diff) | |
parent | 13acc291191281e2980e56dbe3a3d80ce677c9a8 (diff) |
Merge branch 'next/devel-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/soc
Misc SoC-related fixes/cleanups for Samsung platforms
* 'next/devel-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
ARM: SAMSUNG: Add check for NULL in clock interface
ARM: EXYNOS: Put PCM, Slimbus, Spdif clocks to off state
ARM: EXYNOS: Add bus clock for FIMD
ARM: SAMSUNG: Fix HDMI related warnings
ARM: S3C24XX: Add .get_rate callback for "camif-upll" clock
ARM: EXYNOS: Fix incorrect help text
ARM: EXYNOS: Turn off clocks for NAND, OneNAND and TSI controllers
+ sync to 3.6-rc6
Diffstat (limited to 'net/sctp/output.c')
-rw-r--r-- | net/sctp/output.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/net/sctp/output.c b/net/sctp/output.c index 838e18b4d7e..be50aa234dc 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c @@ -364,6 +364,25 @@ finish: return retval; } +static void sctp_packet_release_owner(struct sk_buff *skb) +{ + sk_free(skb->sk); +} + +static void sctp_packet_set_owner_w(struct sk_buff *skb, struct sock *sk) +{ + skb_orphan(skb); + skb->sk = sk; + skb->destructor = sctp_packet_release_owner; + + /* + * The data chunks have already been accounted for in sctp_sendmsg(), + * therefore only reserve a single byte to keep socket around until + * the packet has been transmitted. + */ + atomic_inc(&sk->sk_wmem_alloc); +} + /* All packets are sent to the network through this function from * sctp_outq_tail(). * @@ -405,7 +424,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) /* Set the owning socket so that we know where to get the * destination IP address. */ - skb_set_owner_w(nskb, sk); + sctp_packet_set_owner_w(nskb, sk); if (!sctp_transport_dst_check(tp)) { sctp_transport_route(tp, NULL, sctp_sk(sk)); |