|
@@ -162,8 +162,7 @@ static void atalk_destroy_timer(unsigned long data)
|
|
{
|
|
{
|
|
struct sock *sk = (struct sock *)data;
|
|
struct sock *sk = (struct sock *)data;
|
|
|
|
|
|
- if (atomic_read(&sk->sk_wmem_alloc) ||
|
|
|
|
- atomic_read(&sk->sk_rmem_alloc)) {
|
|
|
|
|
|
+ if (sk_has_allocations(sk)) {
|
|
sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME;
|
|
sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME;
|
|
add_timer(&sk->sk_timer);
|
|
add_timer(&sk->sk_timer);
|
|
} else
|
|
} else
|
|
@@ -175,8 +174,7 @@ static inline void atalk_destroy_socket(struct sock *sk)
|
|
atalk_remove_socket(sk);
|
|
atalk_remove_socket(sk);
|
|
skb_queue_purge(&sk->sk_receive_queue);
|
|
skb_queue_purge(&sk->sk_receive_queue);
|
|
|
|
|
|
- if (atomic_read(&sk->sk_wmem_alloc) ||
|
|
|
|
- atomic_read(&sk->sk_rmem_alloc)) {
|
|
|
|
|
|
+ if (sk_has_allocations(sk)) {
|
|
setup_timer(&sk->sk_timer, atalk_destroy_timer,
|
|
setup_timer(&sk->sk_timer, atalk_destroy_timer,
|
|
(unsigned long)sk);
|
|
(unsigned long)sk);
|
|
sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME;
|
|
sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME;
|