summaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/output.c2
-rw-r--r--net/sctp/proc.c2
-rw-r--r--net/sctp/socket.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/net/sctp/output.c b/net/sctp/output.c
index 89cee1482d35..9bf9d84a96b7 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -402,7 +402,7 @@ static void sctp_packet_set_owner_w(struct sk_buff *skb, struct sock *sk)
402 * therefore only reserve a single byte to keep socket around until 402 * therefore only reserve a single byte to keep socket around until
403 * the packet has been transmitted. 403 * the packet has been transmitted.
404 */ 404 */
405 atomic_inc(&sk->sk_wmem_alloc); 405 refcount_inc(&sk->sk_wmem_alloc);
406} 406}
407 407
408static int sctp_packet_pack(struct sctp_packet *packet, 408static int sctp_packet_pack(struct sctp_packet *packet,
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 8e34db56bc1d..26b4be6b4172 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -363,7 +363,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
363 assoc->stream.outcnt, assoc->max_retrans, 363 assoc->stream.outcnt, assoc->max_retrans,
364 assoc->init_retries, assoc->shutdown_retries, 364 assoc->init_retries, assoc->shutdown_retries,
365 assoc->rtx_data_chunks, 365 assoc->rtx_data_chunks,
366 atomic_read(&sk->sk_wmem_alloc), 366 refcount_read(&sk->sk_wmem_alloc),
367 sk->sk_wmem_queued, 367 sk->sk_wmem_queued,
368 sk->sk_sndbuf, 368 sk->sk_sndbuf,
369 sk->sk_rcvbuf); 369 sk->sk_rcvbuf);
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index b497ee8ae279..15401d09efc4 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -164,7 +164,7 @@ static inline void sctp_set_owner_w(struct sctp_chunk *chunk)
164 sizeof(struct sk_buff) + 164 sizeof(struct sk_buff) +
165 sizeof(struct sctp_chunk); 165 sizeof(struct sctp_chunk);
166 166
167 atomic_add(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc); 167 refcount_add(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc);
168 sk->sk_wmem_queued += chunk->skb->truesize; 168 sk->sk_wmem_queued += chunk->skb->truesize;
169 sk_mem_charge(sk, chunk->skb->truesize); 169 sk_mem_charge(sk, chunk->skb->truesize);
170} 170}
@@ -7684,7 +7684,7 @@ static void sctp_wfree(struct sk_buff *skb)
7684 sizeof(struct sk_buff) + 7684 sizeof(struct sk_buff) +
7685 sizeof(struct sctp_chunk); 7685 sizeof(struct sctp_chunk);
7686 7686
7687 atomic_sub(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc); 7687 WARN_ON(refcount_sub_and_test(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc));
7688 7688
7689 /* 7689 /*
7690 * This undoes what is done via sctp_set_owner_w and sk_mem_charge 7690 * This undoes what is done via sctp_set_owner_w and sk_mem_charge