aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 7a8650f01d08..710df67a6785 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -174,7 +174,8 @@ static inline void sctp_set_owner_w(struct sctp_chunk *chunk)
174 sizeof(struct sctp_chunk); 174 sizeof(struct sctp_chunk);
175 175
176 atomic_add(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc); 176 atomic_add(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc);
177 sk_charge_skb(sk, chunk->skb); 177 sk->sk_wmem_queued += chunk->skb->truesize;
178 sk_mem_charge(sk, chunk->skb->truesize);
178} 179}
179 180
180/* Verify that this is a valid address. */ 181/* Verify that this is a valid address. */
@@ -6035,10 +6036,10 @@ static void sctp_wfree(struct sk_buff *skb)
6035 atomic_sub(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc); 6036 atomic_sub(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc);
6036 6037
6037 /* 6038 /*
6038 * This undoes what is done via sk_charge_skb 6039 * This undoes what is done via sctp_set_owner_w and sk_mem_charge
6039 */ 6040 */
6040 sk->sk_wmem_queued -= skb->truesize; 6041 sk->sk_wmem_queued -= skb->truesize;
6041 sk->sk_forward_alloc += skb->truesize; 6042 sk_mem_uncharge(sk, skb->truesize);
6042 6043
6043 sock_wfree(skb); 6044 sock_wfree(skb);
6044 __sctp_write_space(asoc); 6045 __sctp_write_space(asoc);
@@ -6059,9 +6060,9 @@ void sctp_sock_rfree(struct sk_buff *skb)
6059 atomic_sub(event->rmem_len, &sk->sk_rmem_alloc); 6060 atomic_sub(event->rmem_len, &sk->sk_rmem_alloc);
6060 6061
6061 /* 6062 /*
6062 * Mimic the behavior of sk_stream_rfree 6063 * Mimic the behavior of sock_rfree
6063 */ 6064 */
6064 sk->sk_forward_alloc += event->rmem_len; 6065 sk_mem_uncharge(sk, event->rmem_len);
6065} 6066}
6066 6067
6067 6068