diff options
Diffstat (limited to 'net/appletalk/ddp.c')
-rw-r--r-- | net/appletalk/ddp.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index b603cbacdc58..590b83963622 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c | |||
@@ -162,8 +162,7 @@ static void atalk_destroy_timer(unsigned long data) | |||
162 | { | 162 | { |
163 | struct sock *sk = (struct sock *)data; | 163 | struct sock *sk = (struct sock *)data; |
164 | 164 | ||
165 | if (atomic_read(&sk->sk_wmem_alloc) || | 165 | if (sk_has_allocations(sk)) { |
166 | atomic_read(&sk->sk_rmem_alloc)) { | ||
167 | sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME; | 166 | sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME; |
168 | add_timer(&sk->sk_timer); | 167 | add_timer(&sk->sk_timer); |
169 | } else | 168 | } else |
@@ -175,8 +174,7 @@ static inline void atalk_destroy_socket(struct sock *sk) | |||
175 | atalk_remove_socket(sk); | 174 | atalk_remove_socket(sk); |
176 | skb_queue_purge(&sk->sk_receive_queue); | 175 | skb_queue_purge(&sk->sk_receive_queue); |
177 | 176 | ||
178 | if (atomic_read(&sk->sk_wmem_alloc) || | 177 | if (sk_has_allocations(sk)) { |
179 | atomic_read(&sk->sk_rmem_alloc)) { | ||
180 | setup_timer(&sk->sk_timer, atalk_destroy_timer, | 178 | setup_timer(&sk->sk_timer, atalk_destroy_timer, |
181 | (unsigned long)sk); | 179 | (unsigned long)sk); |
182 | sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME; | 180 | sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME; |
@@ -1750,8 +1748,7 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
1750 | switch (cmd) { | 1748 | switch (cmd) { |
1751 | /* Protocol layer */ | 1749 | /* Protocol layer */ |
1752 | case TIOCOUTQ: { | 1750 | case TIOCOUTQ: { |
1753 | long amount = sk->sk_sndbuf - | 1751 | long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk); |
1754 | atomic_read(&sk->sk_wmem_alloc); | ||
1755 | 1752 | ||
1756 | if (amount < 0) | 1753 | if (amount < 0) |
1757 | amount = 0; | 1754 | amount = 0; |