if (wp_sk(sk)) { kfree(wp_sk(sk)); wp_sk(sk) = NULL; } 
kfree(wp_sk(sk)); wp_sk(sk) = NULL; 
static void wanpipe_kill_sock_timer (unsigned long data){	struct sock *sk = (struct sock *)data;	struct sock **skp;	if (!sk)		return;	/* This function can be called from interrupt. We must use	 * appropriate locks */		if (test_bit(1,&wanpipe_tx_critical)){		sk->sk_timer.expires = jiffies + 10;		add_timer(&sk->sk_timer);		return;	}		write_lock(&wanpipe_sklist_lock);	sk_del_node_init(sk);	write_unlock(&wanpipe_sklist_lock);	if (wp_sk(sk)->num == htons(X25_PROT) &&	    sk->sk_state != WANSOCK_DISCONNECTED) {		struct net_device *dev = dev_get_by_index(sk->sk_bound_dev_if);		wanpipe_common_t *chan;		if (dev){			chan=dev->priv;			atomic_set(&chan->disconnect,1);			dev_put(dev);		}		}	release_driver(sk);	sk->sk_socket = NULL;	/* Purge queues */	skb_queue_purge(&sk->sk_receive_queue);	skb_queue_purge(&sk->sk_write_queue);	skb_queue_purge(&sk->sk_error_queue);		if (atomic_read(&sk->sk_rmem_alloc) ||	    atomic_read(&sk->sk_wmem_alloc)) {		del_timer(&sk->sk_timer);		printk(KERN_INFO "wansock: Killing SOCK in Timer\n");		sk->sk_timer.data	= (unsigned long)sk;		sk->sk_timer.expires	= jiffies + HZ;		sk->sk_timer.function	= wanpipe_destroy_timer;		add_timer(&sk->sk_timer);		return;	}	if (wp_sk(sk)) {		kfree(wp_sk(sk));		wp_sk(sk) = NULL;	}	if (atomic_read(&sk->sk_refcnt) != 1) {		atomic_set(&sk->sk_refcnt, 1);		DBG_PRINTK(KERN_INFO "wansock: Error, wrong reference count: %i ! :timer.\n",					atomic_read(&sk->sk_refcnt));	}	sock_put(sk);	atomic_dec(&wanpipe_socks_nr);	return;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a51482bde22f99c63fbbb57d5d46cc666384e379/af_wanpipe.c/clean/net/wanrouter/af_wanpipe.c