aboutsummaryrefslogtreecommitdiffstats
path: root/net/econet/af_econet.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/econet/af_econet.c')
-rw-r--r--net/econet/af_econet.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index 6f479fa522c3..2e1f836d4240 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -540,8 +540,7 @@ static void econet_destroy_timer(unsigned long data)
540{ 540{
541 struct sock *sk=(struct sock *)data; 541 struct sock *sk=(struct sock *)data;
542 542
543 if (!atomic_read(&sk->sk_wmem_alloc) && 543 if (!sk_has_allocations(sk)) {
544 !atomic_read(&sk->sk_rmem_alloc)) {
545 sk_free(sk); 544 sk_free(sk);
546 return; 545 return;
547 } 546 }
@@ -579,8 +578,7 @@ static int econet_release(struct socket *sock)
579 578
580 skb_queue_purge(&sk->sk_receive_queue); 579 skb_queue_purge(&sk->sk_receive_queue);
581 580
582 if (atomic_read(&sk->sk_rmem_alloc) || 581 if (sk_has_allocations(sk)) {
583 atomic_read(&sk->sk_wmem_alloc)) {
584 sk->sk_timer.data = (unsigned long)sk; 582 sk->sk_timer.data = (unsigned long)sk;
585 sk->sk_timer.expires = jiffies + HZ; 583 sk->sk_timer.expires = jiffies + HZ;
586 sk->sk_timer.function = econet_destroy_timer; 584 sk->sk_timer.function = econet_destroy_timer;
@@ -901,15 +899,10 @@ static void aun_tx_ack(unsigned long seq, int result)
901 struct ec_cb *eb; 899 struct ec_cb *eb;
902 900
903 spin_lock_irqsave(&aun_queue_lock, flags); 901 spin_lock_irqsave(&aun_queue_lock, flags);
904 skb = skb_peek(&aun_queue); 902 skb_queue_walk(&aun_queue, skb) {
905 while (skb && skb != (struct sk_buff *)&aun_queue)
906 {
907 struct sk_buff *newskb = skb->next;
908 eb = (struct ec_cb *)&skb->cb; 903 eb = (struct ec_cb *)&skb->cb;
909 if (eb->seq == seq) 904 if (eb->seq == seq)
910 goto foundit; 905 goto foundit;
911
912 skb = newskb;
913 } 906 }
914 spin_unlock_irqrestore(&aun_queue_lock, flags); 907 spin_unlock_irqrestore(&aun_queue_lock, flags);
915 printk(KERN_DEBUG "AUN: unknown sequence %ld\n", seq); 908 printk(KERN_DEBUG "AUN: unknown sequence %ld\n", seq);
@@ -982,23 +975,18 @@ static void aun_data_available(struct sock *sk, int slen)
982 975
983static void ab_cleanup(unsigned long h) 976static void ab_cleanup(unsigned long h)
984{ 977{
985 struct sk_buff *skb; 978 struct sk_buff *skb, *n;
986 unsigned long flags; 979 unsigned long flags;
987 980
988 spin_lock_irqsave(&aun_queue_lock, flags); 981 spin_lock_irqsave(&aun_queue_lock, flags);
989 skb = skb_peek(&aun_queue); 982 skb_queue_walk_safe(&aun_queue, skb, n) {
990 while (skb && skb != (struct sk_buff *)&aun_queue)
991 {
992 struct sk_buff *newskb = skb->next;
993 struct ec_cb *eb = (struct ec_cb *)&skb->cb; 983 struct ec_cb *eb = (struct ec_cb *)&skb->cb;
994 if ((jiffies - eb->start) > eb->timeout) 984 if ((jiffies - eb->start) > eb->timeout) {
995 {
996 tx_result(skb->sk, eb->cookie, 985 tx_result(skb->sk, eb->cookie,
997 ECTYPE_TRANSMIT_NOT_PRESENT); 986 ECTYPE_TRANSMIT_NOT_PRESENT);
998 skb_unlink(skb, &aun_queue); 987 skb_unlink(skb, &aun_queue);
999 kfree_skb(skb); 988 kfree_skb(skb);
1000 } 989 }
1001 skb = newskb;
1002 } 990 }
1003 spin_unlock_irqrestore(&aun_queue_lock, flags); 991 spin_unlock_irqrestore(&aun_queue_lock, flags);
1004 992