diff options
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/bnep/sock.c | 4 | ||||
-rw-r--r-- | net/bluetooth/cmtp/sock.c | 4 | ||||
-rw-r--r-- | net/bluetooth/hci_conn.c | 9 | ||||
-rw-r--r-- | net/bluetooth/hidp/core.c | 5 | ||||
-rw-r--r-- | net/bluetooth/hidp/sock.c | 10 | ||||
-rw-r--r-- | net/bluetooth/l2cap.c | 13 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 4 | ||||
-rw-r--r-- | net/bluetooth/sco.c | 9 |
8 files changed, 16 insertions, 42 deletions
diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c index 9ebd3c64474d..81065e548a1f 100644 --- a/net/bluetooth/bnep/sock.c +++ b/net/bluetooth/bnep/sock.c | |||
@@ -94,7 +94,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long | |||
94 | return err; | 94 | return err; |
95 | 95 | ||
96 | if (nsock->sk->sk_state != BT_CONNECTED) { | 96 | if (nsock->sk->sk_state != BT_CONNECTED) { |
97 | fput(nsock->file); | 97 | sockfd_put(nsock); |
98 | return -EBADFD; | 98 | return -EBADFD; |
99 | } | 99 | } |
100 | 100 | ||
@@ -103,7 +103,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long | |||
103 | if (copy_to_user(argp, &ca, sizeof(ca))) | 103 | if (copy_to_user(argp, &ca, sizeof(ca))) |
104 | err = -EFAULT; | 104 | err = -EFAULT; |
105 | } else | 105 | } else |
106 | fput(nsock->file); | 106 | sockfd_put(nsock); |
107 | 107 | ||
108 | return err; | 108 | return err; |
109 | 109 | ||
diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c index 783edab12ce8..8c7f7bc4e0ba 100644 --- a/net/bluetooth/cmtp/sock.c +++ b/net/bluetooth/cmtp/sock.c | |||
@@ -88,7 +88,7 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long | |||
88 | return err; | 88 | return err; |
89 | 89 | ||
90 | if (nsock->sk->sk_state != BT_CONNECTED) { | 90 | if (nsock->sk->sk_state != BT_CONNECTED) { |
91 | fput(nsock->file); | 91 | sockfd_put(nsock); |
92 | return -EBADFD; | 92 | return -EBADFD; |
93 | } | 93 | } |
94 | 94 | ||
@@ -97,7 +97,7 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long | |||
97 | if (copy_to_user(argp, &ca, sizeof(ca))) | 97 | if (copy_to_user(argp, &ca, sizeof(ca))) |
98 | err = -EFAULT; | 98 | err = -EFAULT; |
99 | } else | 99 | } else |
100 | fput(nsock->file); | 100 | sockfd_put(nsock); |
101 | 101 | ||
102 | return err; | 102 | return err; |
103 | 103 | ||
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 34d1a3c822bf..5fc7be206f62 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -208,13 +208,8 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst) | |||
208 | 208 | ||
209 | skb_queue_head_init(&conn->data_q); | 209 | skb_queue_head_init(&conn->data_q); |
210 | 210 | ||
211 | init_timer(&conn->disc_timer); | 211 | setup_timer(&conn->disc_timer, hci_conn_timeout, (unsigned long)conn); |
212 | conn->disc_timer.function = hci_conn_timeout; | 212 | setup_timer(&conn->idle_timer, hci_conn_idle, (unsigned long)conn); |
213 | conn->disc_timer.data = (unsigned long) conn; | ||
214 | |||
215 | init_timer(&conn->idle_timer); | ||
216 | conn->idle_timer.function = hci_conn_idle; | ||
217 | conn->idle_timer.data = (unsigned long) conn; | ||
218 | 213 | ||
219 | atomic_set(&conn->refcnt, 0); | 214 | atomic_set(&conn->refcnt, 0); |
220 | 215 | ||
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index 4bbacddeb49d..782a22602b86 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c | |||
@@ -811,10 +811,7 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, | |||
811 | session->intr_sock = intr_sock; | 811 | session->intr_sock = intr_sock; |
812 | session->state = BT_CONNECTED; | 812 | session->state = BT_CONNECTED; |
813 | 813 | ||
814 | init_timer(&session->timer); | 814 | setup_timer(&session->timer, hidp_idle_timeout, (unsigned long)session); |
815 | |||
816 | session->timer.function = hidp_idle_timeout; | ||
817 | session->timer.data = (unsigned long) session; | ||
818 | 815 | ||
819 | skb_queue_head_init(&session->ctrl_transmit); | 816 | skb_queue_head_init(&session->ctrl_transmit); |
820 | skb_queue_head_init(&session->intr_transmit); | 817 | skb_queue_head_init(&session->intr_transmit); |
diff --git a/net/bluetooth/hidp/sock.c b/net/bluetooth/hidp/sock.c index 3292b956a7c4..f4dd02ca9a96 100644 --- a/net/bluetooth/hidp/sock.c +++ b/net/bluetooth/hidp/sock.c | |||
@@ -86,13 +86,13 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long | |||
86 | 86 | ||
87 | isock = sockfd_lookup(ca.intr_sock, &err); | 87 | isock = sockfd_lookup(ca.intr_sock, &err); |
88 | if (!isock) { | 88 | if (!isock) { |
89 | fput(csock->file); | 89 | sockfd_put(csock); |
90 | return err; | 90 | return err; |
91 | } | 91 | } |
92 | 92 | ||
93 | if (csock->sk->sk_state != BT_CONNECTED || isock->sk->sk_state != BT_CONNECTED) { | 93 | if (csock->sk->sk_state != BT_CONNECTED || isock->sk->sk_state != BT_CONNECTED) { |
94 | fput(csock->file); | 94 | sockfd_put(csock); |
95 | fput(isock->file); | 95 | sockfd_put(isock); |
96 | return -EBADFD; | 96 | return -EBADFD; |
97 | } | 97 | } |
98 | 98 | ||
@@ -101,8 +101,8 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long | |||
101 | if (copy_to_user(argp, &ca, sizeof(ca))) | 101 | if (copy_to_user(argp, &ca, sizeof(ca))) |
102 | err = -EFAULT; | 102 | err = -EFAULT; |
103 | } else { | 103 | } else { |
104 | fput(csock->file); | 104 | sockfd_put(csock); |
105 | fput(isock->file); | 105 | sockfd_put(isock); |
106 | } | 106 | } |
107 | 107 | ||
108 | return err; | 108 | return err; |
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 477e052b17b5..a8811c0a0cea 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -99,13 +99,6 @@ static void l2cap_sock_clear_timer(struct sock *sk) | |||
99 | sk_stop_timer(sk, &sk->sk_timer); | 99 | sk_stop_timer(sk, &sk->sk_timer); |
100 | } | 100 | } |
101 | 101 | ||
102 | static void l2cap_sock_init_timer(struct sock *sk) | ||
103 | { | ||
104 | init_timer(&sk->sk_timer); | ||
105 | sk->sk_timer.function = l2cap_sock_timeout; | ||
106 | sk->sk_timer.data = (unsigned long)sk; | ||
107 | } | ||
108 | |||
109 | /* ---- L2CAP channels ---- */ | 102 | /* ---- L2CAP channels ---- */ |
110 | static struct sock *__l2cap_get_chan_by_dcid(struct l2cap_chan_list *l, u16 cid) | 103 | static struct sock *__l2cap_get_chan_by_dcid(struct l2cap_chan_list *l, u16 cid) |
111 | { | 104 | { |
@@ -395,9 +388,7 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status) | |||
395 | 388 | ||
396 | conn->feat_mask = 0; | 389 | conn->feat_mask = 0; |
397 | 390 | ||
398 | init_timer(&conn->info_timer); | 391 | setup_timer(&conn->info_timer, l2cap_info_timeout, (unsigned long)conn); |
399 | conn->info_timer.function = l2cap_info_timeout; | ||
400 | conn->info_timer.data = (unsigned long) conn; | ||
401 | 392 | ||
402 | spin_lock_init(&conn->lock); | 393 | spin_lock_init(&conn->lock); |
403 | rwlock_init(&conn->chan_list.lock); | 394 | rwlock_init(&conn->chan_list.lock); |
@@ -622,7 +613,7 @@ static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int p | |||
622 | sk->sk_protocol = proto; | 613 | sk->sk_protocol = proto; |
623 | sk->sk_state = BT_OPEN; | 614 | sk->sk_state = BT_OPEN; |
624 | 615 | ||
625 | l2cap_sock_init_timer(sk); | 616 | setup_timer(&sk->sk_timer, l2cap_sock_timeout, (unsigned long)sk); |
626 | 617 | ||
627 | bt_sock_link(&l2cap_sk_list, sk); | 618 | bt_sock_link(&l2cap_sk_list, sk); |
628 | return sk; | 619 | return sk; |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index e7ac6ba7ecab..d3e4e1877e6a 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -279,9 +279,7 @@ struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio) | |||
279 | if (!d) | 279 | if (!d) |
280 | return NULL; | 280 | return NULL; |
281 | 281 | ||
282 | init_timer(&d->timer); | 282 | setup_timer(&d->timer, rfcomm_dlc_timeout, (unsigned long)d); |
283 | d->timer.function = rfcomm_dlc_timeout; | ||
284 | d->timer.data = (unsigned long) d; | ||
285 | 283 | ||
286 | skb_queue_head_init(&d->tx_queue); | 284 | skb_queue_head_init(&d->tx_queue); |
287 | spin_lock_init(&d->lock); | 285 | spin_lock_init(&d->lock); |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 93ad1aae3f38..b91d3c81a73c 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -97,13 +97,6 @@ static void sco_sock_clear_timer(struct sock *sk) | |||
97 | sk_stop_timer(sk, &sk->sk_timer); | 97 | sk_stop_timer(sk, &sk->sk_timer); |
98 | } | 98 | } |
99 | 99 | ||
100 | static void sco_sock_init_timer(struct sock *sk) | ||
101 | { | ||
102 | init_timer(&sk->sk_timer); | ||
103 | sk->sk_timer.function = sco_sock_timeout; | ||
104 | sk->sk_timer.data = (unsigned long)sk; | ||
105 | } | ||
106 | |||
107 | /* ---- SCO connections ---- */ | 100 | /* ---- SCO connections ---- */ |
108 | static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) | 101 | static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) |
109 | { | 102 | { |
@@ -436,7 +429,7 @@ static struct sock *sco_sock_alloc(struct net *net, struct socket *sock, int pro | |||
436 | sk->sk_protocol = proto; | 429 | sk->sk_protocol = proto; |
437 | sk->sk_state = BT_OPEN; | 430 | sk->sk_state = BT_OPEN; |
438 | 431 | ||
439 | sco_sock_init_timer(sk); | 432 | setup_timer(&sk->sk_timer, sco_sock_timeout, (unsigned long)sk); |
440 | 433 | ||
441 | bt_sock_link(&sco_sk_list, sk); | 434 | bt_sock_link(&sco_sk_list, sk); |
442 | return sk; | 435 | return sk; |