diff options
Diffstat (limited to 'net/bluetooth/hidp/core.c')
-rw-r--r-- | net/bluetooth/hidp/core.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index 03b5dadb4951..66782010f82c 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c | |||
@@ -507,14 +507,12 @@ static int hidp_session(void *arg) | |||
507 | 507 | ||
508 | hidp_del_timer(session); | 508 | hidp_del_timer(session); |
509 | 509 | ||
510 | if (intr_sk->sk_state != BT_CONNECTED) | 510 | fput(session->intr_sock->file); |
511 | wait_event_timeout(*(ctrl_sk->sk_sleep), (ctrl_sk->sk_state == BT_CLOSED), HZ); | ||
512 | |||
513 | fput(session->ctrl_sock->file); | ||
514 | 511 | ||
515 | wait_event_timeout(*(intr_sk->sk_sleep), (intr_sk->sk_state == BT_CLOSED), HZ); | 512 | wait_event_timeout(*(ctrl_sk->sk_sleep), |
513 | (ctrl_sk->sk_state == BT_CLOSED), msecs_to_jiffies(500)); | ||
516 | 514 | ||
517 | fput(session->intr_sock->file); | 515 | fput(session->ctrl_sock->file); |
518 | 516 | ||
519 | __hidp_unlink_session(session); | 517 | __hidp_unlink_session(session); |
520 | 518 | ||
@@ -541,12 +539,10 @@ static struct device *hidp_get_device(struct hidp_session *session) | |||
541 | return NULL; | 539 | return NULL; |
542 | 540 | ||
543 | conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst); | 541 | conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst); |
544 | if (!conn) | ||
545 | return NULL; | ||
546 | 542 | ||
547 | hci_dev_put(hdev); | 543 | hci_dev_put(hdev); |
548 | 544 | ||
549 | return &conn->dev; | 545 | return conn ? &conn->dev : NULL; |
550 | } | 546 | } |
551 | 547 | ||
552 | static inline void hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req) | 548 | static inline void hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req) |