aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hidp/core.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 43b4c2deb7cc..7e19a012970e 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -1044,8 +1044,12 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
1044 } 1044 }
1045 1045
1046 err = hid_add_device(session->hid); 1046 err = hid_add_device(session->hid);
1047 if (err < 0) 1047 if (err < 0) {
1048 goto err_add_device; 1048 atomic_inc(&session->terminate);
1049 wake_up_process(session->task);
1050 up_write(&hidp_session_sem);
1051 return err;
1052 }
1049 1053
1050 if (session->input) { 1054 if (session->input) {
1051 hidp_send_ctrl_message(session, 1055 hidp_send_ctrl_message(session,
@@ -1059,12 +1063,6 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
1059 up_write(&hidp_session_sem); 1063 up_write(&hidp_session_sem);
1060 return 0; 1064 return 0;
1061 1065
1062err_add_device:
1063 hid_destroy_device(session->hid);
1064 session->hid = NULL;
1065 atomic_inc(&session->terminate);
1066 wake_up_process(session->task);
1067
1068unlink: 1066unlink:
1069 hidp_del_timer(session); 1067 hidp_del_timer(session);
1070 1068