kfree(session->input); 
session->input = NULL; 
static int hidp_session(void *arg){	struct hidp_session *session = arg;	struct sock *ctrl_sk = session->ctrl_sock->sk;	struct sock *intr_sk = session->intr_sock->sk;	struct sk_buff *skb;	int vendor = 0x0000, product = 0x0000;	wait_queue_t ctrl_wait, intr_wait;	BT_DBG("session %p", session);	if (session->input) {		vendor  = session->input->id.vendor;		product = session->input->id.product;	}	daemonize("khidpd_%04x%04x", vendor, product);	set_user_nice(current, -15);	current->flags |= PF_NOFREEZE;	init_waitqueue_entry(&ctrl_wait, current);	init_waitqueue_entry(&intr_wait, current);	add_wait_queue(ctrl_sk->sk_sleep, &ctrl_wait);	add_wait_queue(intr_sk->sk_sleep, &intr_wait);	while (!atomic_read(&session->terminate)) {		set_current_state(TASK_INTERRUPTIBLE);		if (ctrl_sk->sk_state != BT_CONNECTED || intr_sk->sk_state != BT_CONNECTED)			break;		while ((skb = skb_dequeue(&ctrl_sk->sk_receive_queue))) {			skb_orphan(skb);			hidp_recv_ctrl_frame(session, skb);		}		while ((skb = skb_dequeue(&intr_sk->sk_receive_queue))) {			skb_orphan(skb);			hidp_recv_intr_frame(session, skb);		}		hidp_process_transmit(session);		schedule();	}	set_current_state(TASK_RUNNING);	remove_wait_queue(intr_sk->sk_sleep, &intr_wait);	remove_wait_queue(ctrl_sk->sk_sleep, &ctrl_wait);	down_write(&hidp_session_sem);	hidp_del_timer(session);	if (intr_sk->sk_state != BT_CONNECTED)		wait_event_timeout(*(ctrl_sk->sk_sleep), (ctrl_sk->sk_state == BT_CLOSED), HZ);	fput(session->ctrl_sock->file);	wait_event_timeout(*(intr_sk->sk_sleep), (intr_sk->sk_state == BT_CLOSED), HZ);	fput(session->intr_sock->file);	__hidp_unlink_session(session);	if (session->input) {		input_unregister_device(session->input);		kfree(session->input);	}	up_write(&hidp_session_sem);	kfree(session);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/34abf91f4036c01669e298e649b7ba85cadf82eb/core.c/clean/net/bluetooth/hidp/core.c