diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-13 00:19:42 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-13 00:19:42 -0400 |
| commit | e47f31787dee5bf57453e18edefff56e17fa44f9 (patch) | |
| tree | 6c86b53192526bf9b7f6581720dbd12dc085aff5 /net/bluetooth | |
| parent | a0486407bea3f0545ee3fcfb768b6763c5c2b459 (diff) | |
| parent | a6f157a88d1398d7ccb743c5a56138edf6f6ef0b (diff) | |
Merge commit master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 of HEAD
* HEAD:
[NET]: fix __sk_stream_mem_reclaim
[Bluetooth] Fix deadlock in the L2CAP layer
[Bluetooth] Let BT_HIDP depend on INPUT
[Bluetooth] Avoid NULL pointer dereference with tty->driver
[Bluetooth] Remaining transitions to use kzalloc()
[WAN]: converting generic HDLC to use netif_dormant*()
[IPV4]: Fix error handling for fib_insert_node call
[NETROM] lockdep: fix false positive
[ROSE] lockdep: fix false positive
[AX.25]: Optimize AX.25 socket list lock
[IPCOMP]: Fix truesize after decompression
[IPV6]: Use ipv6_addr_src_scope for link address sorting.
[TCP] tcp_highspeed: Fix AI updates.
[MAINTAINERS]: Add proper entry for TC classifier
[NETROM]: Drop lock before calling nr_destroy_socket
[NETROM]: Fix locking order when establishing a NETROM circuit.
[AX.25]: Fix locking of ax25 protocol function list.
[IPV6]: order addresses by scope
Diffstat (limited to 'net/bluetooth')
| -rw-r--r-- | net/bluetooth/cmtp/capi.c | 4 | ||||
| -rw-r--r-- | net/bluetooth/cmtp/core.c | 3 | ||||
| -rw-r--r-- | net/bluetooth/hci_core.c | 7 | ||||
| -rw-r--r-- | net/bluetooth/hidp/Kconfig | 3 | ||||
| -rw-r--r-- | net/bluetooth/hidp/core.c | 3 | ||||
| -rw-r--r-- | net/bluetooth/l2cap.c | 18 | ||||
| -rw-r--r-- | net/bluetooth/rfcomm/core.c | 9 | ||||
| -rw-r--r-- | net/bluetooth/rfcomm/tty.c | 3 | ||||
| -rw-r--r-- | net/bluetooth/sco.c | 12 |
9 files changed, 26 insertions, 36 deletions
diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c index 6fb47e00e188..be04e9fb11f6 100644 --- a/net/bluetooth/cmtp/capi.c +++ b/net/bluetooth/cmtp/capi.c | |||
| @@ -75,15 +75,13 @@ | |||
| 75 | 75 | ||
| 76 | static struct cmtp_application *cmtp_application_add(struct cmtp_session *session, __u16 appl) | 76 | static struct cmtp_application *cmtp_application_add(struct cmtp_session *session, __u16 appl) |
| 77 | { | 77 | { |
| 78 | struct cmtp_application *app = kmalloc(sizeof(*app), GFP_KERNEL); | 78 | struct cmtp_application *app = kzalloc(sizeof(*app), GFP_KERNEL); |
| 79 | 79 | ||
| 80 | BT_DBG("session %p application %p appl %d", session, app, appl); | 80 | BT_DBG("session %p application %p appl %d", session, app, appl); |
| 81 | 81 | ||
| 82 | if (!app) | 82 | if (!app) |
| 83 | return NULL; | 83 | return NULL; |
| 84 | 84 | ||
| 85 | memset(app, 0, sizeof(*app)); | ||
| 86 | |||
| 87 | app->state = BT_OPEN; | 85 | app->state = BT_OPEN; |
| 88 | app->appl = appl; | 86 | app->appl = appl; |
| 89 | 87 | ||
diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c index 182254a580e2..b81a01c64aea 100644 --- a/net/bluetooth/cmtp/core.c +++ b/net/bluetooth/cmtp/core.c | |||
| @@ -335,10 +335,9 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock) | |||
| 335 | baswap(&src, &bt_sk(sock->sk)->src); | 335 | baswap(&src, &bt_sk(sock->sk)->src); |
| 336 | baswap(&dst, &bt_sk(sock->sk)->dst); | 336 | baswap(&dst, &bt_sk(sock->sk)->dst); |
| 337 | 337 | ||
| 338 | session = kmalloc(sizeof(struct cmtp_session), GFP_KERNEL); | 338 | session = kzalloc(sizeof(struct cmtp_session), GFP_KERNEL); |
| 339 | if (!session) | 339 | if (!session) |
| 340 | return -ENOMEM; | 340 | return -ENOMEM; |
| 341 | memset(session, 0, sizeof(struct cmtp_session)); | ||
| 342 | 341 | ||
| 343 | down_write(&cmtp_session_sem); | 342 | down_write(&cmtp_session_sem); |
| 344 | 343 | ||
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 54e8e5ea2154..5ed474277903 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
| @@ -336,9 +336,8 @@ void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data) | |||
| 336 | 336 | ||
| 337 | if (!(e = hci_inquiry_cache_lookup(hdev, &data->bdaddr))) { | 337 | if (!(e = hci_inquiry_cache_lookup(hdev, &data->bdaddr))) { |
| 338 | /* Entry not in the cache. Add new one. */ | 338 | /* Entry not in the cache. Add new one. */ |
| 339 | if (!(e = kmalloc(sizeof(struct inquiry_entry), GFP_ATOMIC))) | 339 | if (!(e = kzalloc(sizeof(struct inquiry_entry), GFP_ATOMIC))) |
| 340 | return; | 340 | return; |
| 341 | memset(e, 0, sizeof(struct inquiry_entry)); | ||
| 342 | e->next = cache->list; | 341 | e->next = cache->list; |
| 343 | cache->list = e; | 342 | cache->list = e; |
| 344 | } | 343 | } |
| @@ -800,12 +799,10 @@ struct hci_dev *hci_alloc_dev(void) | |||
| 800 | { | 799 | { |
| 801 | struct hci_dev *hdev; | 800 | struct hci_dev *hdev; |
| 802 | 801 | ||
| 803 | hdev = kmalloc(sizeof(struct hci_dev), GFP_KERNEL); | 802 | hdev = kzalloc(sizeof(struct hci_dev), GFP_KERNEL); |
| 804 | if (!hdev) | 803 | if (!hdev) |
| 805 | return NULL; | 804 | return NULL; |
| 806 | 805 | ||
| 807 | memset(hdev, 0, sizeof(struct hci_dev)); | ||
| 808 | |||
| 809 | skb_queue_head_init(&hdev->driver_init); | 806 | skb_queue_head_init(&hdev->driver_init); |
| 810 | 807 | ||
| 811 | return hdev; | 808 | return hdev; |
diff --git a/net/bluetooth/hidp/Kconfig b/net/bluetooth/hidp/Kconfig index edfea772fb67..c6abf2a5a932 100644 --- a/net/bluetooth/hidp/Kconfig +++ b/net/bluetooth/hidp/Kconfig | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | config BT_HIDP | 1 | config BT_HIDP |
| 2 | tristate "HIDP protocol support" | 2 | tristate "HIDP protocol support" |
| 3 | depends on BT && BT_L2CAP && (BROKEN || !S390) | 3 | depends on BT && BT_L2CAP && INPUT |
| 4 | select INPUT | ||
| 5 | help | 4 | help |
| 6 | HIDP (Human Interface Device Protocol) is a transport layer | 5 | HIDP (Human Interface Device Protocol) is a transport layer |
| 7 | for HID reports. HIDP is required for the Bluetooth Human | 6 | for HID reports. HIDP is required for the Bluetooth Human |
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index b9c24a55425c..c6e3a2c27c6e 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c | |||
| @@ -582,10 +582,9 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, | |||
| 582 | bacmp(&bt_sk(ctrl_sock->sk)->dst, &bt_sk(intr_sock->sk)->dst)) | 582 | bacmp(&bt_sk(ctrl_sock->sk)->dst, &bt_sk(intr_sock->sk)->dst)) |
| 583 | return -ENOTUNIQ; | 583 | return -ENOTUNIQ; |
| 584 | 584 | ||
| 585 | session = kmalloc(sizeof(struct hidp_session), GFP_KERNEL); | 585 | session = kzalloc(sizeof(struct hidp_session), GFP_KERNEL); |
| 586 | if (!session) | 586 | if (!session) |
| 587 | return -ENOMEM; | 587 | return -ENOMEM; |
| 588 | memset(session, 0, sizeof(struct hidp_session)); | ||
| 589 | 588 | ||
| 590 | session->input = input_allocate_device(); | 589 | session->input = input_allocate_device(); |
| 591 | if (!session->input) { | 590 | if (!session->input) { |
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index eaaad658d11d..d56f60b392ac 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
| @@ -185,7 +185,7 @@ static inline void l2cap_chan_unlink(struct l2cap_chan_list *l, struct sock *sk) | |||
| 185 | { | 185 | { |
| 186 | struct sock *next = l2cap_pi(sk)->next_c, *prev = l2cap_pi(sk)->prev_c; | 186 | struct sock *next = l2cap_pi(sk)->next_c, *prev = l2cap_pi(sk)->prev_c; |
| 187 | 187 | ||
| 188 | write_lock(&l->lock); | 188 | write_lock_bh(&l->lock); |
| 189 | if (sk == l->head) | 189 | if (sk == l->head) |
| 190 | l->head = next; | 190 | l->head = next; |
| 191 | 191 | ||
| @@ -193,7 +193,7 @@ static inline void l2cap_chan_unlink(struct l2cap_chan_list *l, struct sock *sk) | |||
| 193 | l2cap_pi(next)->prev_c = prev; | 193 | l2cap_pi(next)->prev_c = prev; |
| 194 | if (prev) | 194 | if (prev) |
| 195 | l2cap_pi(prev)->next_c = next; | 195 | l2cap_pi(prev)->next_c = next; |
| 196 | write_unlock(&l->lock); | 196 | write_unlock_bh(&l->lock); |
| 197 | 197 | ||
| 198 | __sock_put(sk); | 198 | __sock_put(sk); |
| 199 | } | 199 | } |
| @@ -313,9 +313,9 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err) | |||
| 313 | static inline void l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct sock *parent) | 313 | static inline void l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct sock *parent) |
| 314 | { | 314 | { |
| 315 | struct l2cap_chan_list *l = &conn->chan_list; | 315 | struct l2cap_chan_list *l = &conn->chan_list; |
| 316 | write_lock(&l->lock); | 316 | write_lock_bh(&l->lock); |
| 317 | __l2cap_chan_add(conn, sk, parent); | 317 | __l2cap_chan_add(conn, sk, parent); |
| 318 | write_unlock(&l->lock); | 318 | write_unlock_bh(&l->lock); |
| 319 | } | 319 | } |
| 320 | 320 | ||
| 321 | static inline u8 l2cap_get_ident(struct l2cap_conn *conn) | 321 | static inline u8 l2cap_get_ident(struct l2cap_conn *conn) |
| @@ -328,14 +328,14 @@ static inline u8 l2cap_get_ident(struct l2cap_conn *conn) | |||
| 328 | * 200 - 254 are used by utilities like l2ping, etc. | 328 | * 200 - 254 are used by utilities like l2ping, etc. |
| 329 | */ | 329 | */ |
| 330 | 330 | ||
| 331 | spin_lock(&conn->lock); | 331 | spin_lock_bh(&conn->lock); |
| 332 | 332 | ||
| 333 | if (++conn->tx_ident > 128) | 333 | if (++conn->tx_ident > 128) |
| 334 | conn->tx_ident = 1; | 334 | conn->tx_ident = 1; |
| 335 | 335 | ||
| 336 | id = conn->tx_ident; | 336 | id = conn->tx_ident; |
| 337 | 337 | ||
| 338 | spin_unlock(&conn->lock); | 338 | spin_unlock_bh(&conn->lock); |
| 339 | 339 | ||
| 340 | return id; | 340 | return id; |
| 341 | } | 341 | } |
| @@ -1416,11 +1416,11 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd | |||
| 1416 | if (!sk) | 1416 | if (!sk) |
| 1417 | goto response; | 1417 | goto response; |
| 1418 | 1418 | ||
| 1419 | write_lock(&list->lock); | 1419 | write_lock_bh(&list->lock); |
| 1420 | 1420 | ||
| 1421 | /* Check if we already have channel with that dcid */ | 1421 | /* Check if we already have channel with that dcid */ |
| 1422 | if (__l2cap_get_chan_by_dcid(list, scid)) { | 1422 | if (__l2cap_get_chan_by_dcid(list, scid)) { |
| 1423 | write_unlock(&list->lock); | 1423 | write_unlock_bh(&list->lock); |
| 1424 | sock_set_flag(sk, SOCK_ZAPPED); | 1424 | sock_set_flag(sk, SOCK_ZAPPED); |
| 1425 | l2cap_sock_kill(sk); | 1425 | l2cap_sock_kill(sk); |
| 1426 | goto response; | 1426 | goto response; |
| @@ -1458,7 +1458,7 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd | |||
| 1458 | result = status = 0; | 1458 | result = status = 0; |
| 1459 | 1459 | ||
| 1460 | done: | 1460 | done: |
| 1461 | write_unlock(&list->lock); | 1461 | write_unlock_bh(&list->lock); |
| 1462 | 1462 | ||
| 1463 | response: | 1463 | response: |
| 1464 | bh_unlock_sock(parent); | 1464 | bh_unlock_sock(parent); |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 155a2b93760e..77eab8f4c7fd 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
| @@ -273,10 +273,10 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d) | |||
| 273 | 273 | ||
| 274 | struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio) | 274 | struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio) |
| 275 | { | 275 | { |
| 276 | struct rfcomm_dlc *d = kmalloc(sizeof(*d), prio); | 276 | struct rfcomm_dlc *d = kzalloc(sizeof(*d), prio); |
| 277 | |||
| 277 | if (!d) | 278 | if (!d) |
| 278 | return NULL; | 279 | return NULL; |
| 279 | memset(d, 0, sizeof(*d)); | ||
| 280 | 280 | ||
| 281 | init_timer(&d->timer); | 281 | init_timer(&d->timer); |
| 282 | d->timer.function = rfcomm_dlc_timeout; | 282 | d->timer.function = rfcomm_dlc_timeout; |
| @@ -289,6 +289,7 @@ struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio) | |||
| 289 | rfcomm_dlc_clear_state(d); | 289 | rfcomm_dlc_clear_state(d); |
| 290 | 290 | ||
| 291 | BT_DBG("%p", d); | 291 | BT_DBG("%p", d); |
| 292 | |||
| 292 | return d; | 293 | return d; |
| 293 | } | 294 | } |
| 294 | 295 | ||
| @@ -522,10 +523,10 @@ int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig) | |||
| 522 | /* ---- RFCOMM sessions ---- */ | 523 | /* ---- RFCOMM sessions ---- */ |
| 523 | static struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state) | 524 | static struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state) |
| 524 | { | 525 | { |
| 525 | struct rfcomm_session *s = kmalloc(sizeof(*s), GFP_KERNEL); | 526 | struct rfcomm_session *s = kzalloc(sizeof(*s), GFP_KERNEL); |
| 527 | |||
| 526 | if (!s) | 528 | if (!s) |
| 527 | return NULL; | 529 | return NULL; |
| 528 | memset(s, 0, sizeof(*s)); | ||
| 529 | 530 | ||
| 530 | BT_DBG("session %p sock %p", s, sock); | 531 | BT_DBG("session %p sock %p", s, sock); |
| 531 | 532 | ||
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index 2ff2d5b87c93..bd8d671a0ba6 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
| @@ -169,10 +169,9 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc) | |||
| 169 | 169 | ||
| 170 | BT_DBG("id %d channel %d", req->dev_id, req->channel); | 170 | BT_DBG("id %d channel %d", req->dev_id, req->channel); |
| 171 | 171 | ||
| 172 | dev = kmalloc(sizeof(struct rfcomm_dev), GFP_KERNEL); | 172 | dev = kzalloc(sizeof(struct rfcomm_dev), GFP_KERNEL); |
| 173 | if (!dev) | 173 | if (!dev) |
| 174 | return -ENOMEM; | 174 | return -ENOMEM; |
| 175 | memset(dev, 0, sizeof(struct rfcomm_dev)); | ||
| 176 | 175 | ||
| 177 | write_lock_bh(&rfcomm_dev_lock); | 176 | write_lock_bh(&rfcomm_dev_lock); |
| 178 | 177 | ||
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 85defccc0287..7714a2ec3854 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
| @@ -108,17 +108,14 @@ static void sco_sock_init_timer(struct sock *sk) | |||
| 108 | static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) | 108 | static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) |
| 109 | { | 109 | { |
| 110 | struct hci_dev *hdev = hcon->hdev; | 110 | struct hci_dev *hdev = hcon->hdev; |
| 111 | struct sco_conn *conn; | 111 | struct sco_conn *conn = hcon->sco_data; |
| 112 | |||
| 113 | if ((conn = hcon->sco_data)) | ||
| 114 | return conn; | ||
| 115 | 112 | ||
| 116 | if (status) | 113 | if (conn || status) |
| 117 | return conn; | 114 | return conn; |
| 118 | 115 | ||
| 119 | if (!(conn = kmalloc(sizeof(struct sco_conn), GFP_ATOMIC))) | 116 | conn = kzalloc(sizeof(struct sco_conn), GFP_ATOMIC); |
| 117 | if (!conn) | ||
| 120 | return NULL; | 118 | return NULL; |
| 121 | memset(conn, 0, sizeof(struct sco_conn)); | ||
| 122 | 119 | ||
| 123 | spin_lock_init(&conn->lock); | 120 | spin_lock_init(&conn->lock); |
| 124 | 121 | ||
| @@ -134,6 +131,7 @@ static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) | |||
| 134 | conn->mtu = 60; | 131 | conn->mtu = 60; |
| 135 | 132 | ||
| 136 | BT_DBG("hcon %p conn %p", hcon, conn); | 133 | BT_DBG("hcon %p conn %p", hcon, conn); |
| 134 | |||
| 137 | return conn; | 135 | return conn; |
| 138 | } | 136 | } |
| 139 | 137 | ||
