diff options
-rw-r--r-- | net/bluetooth/hidp/core.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index 64d89ca28847..ff5784b440d7 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c | |||
@@ -625,7 +625,7 @@ static struct device *hidp_get_device(struct hidp_session *session) | |||
625 | return conn ? &conn->dev : NULL; | 625 | return conn ? &conn->dev : NULL; |
626 | } | 626 | } |
627 | 627 | ||
628 | static inline void hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req) | 628 | static inline int hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req) |
629 | { | 629 | { |
630 | struct input_dev *input = session->input; | 630 | struct input_dev *input = session->input; |
631 | int i; | 631 | int i; |
@@ -667,7 +667,7 @@ static inline void hidp_setup_input(struct hidp_session *session, struct hidp_co | |||
667 | 667 | ||
668 | input->event = hidp_input_event; | 668 | input->event = hidp_input_event; |
669 | 669 | ||
670 | input_register_device(input); | 670 | return input_register_device(input); |
671 | } | 671 | } |
672 | 672 | ||
673 | static int hidp_open(struct hid_device *hid) | 673 | static int hidp_open(struct hid_device *hid) |
@@ -820,8 +820,11 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, | |||
820 | session->flags = req->flags & (1 << HIDP_BLUETOOTH_VENDOR_ID); | 820 | session->flags = req->flags & (1 << HIDP_BLUETOOTH_VENDOR_ID); |
821 | session->idle_to = req->idle_to; | 821 | session->idle_to = req->idle_to; |
822 | 822 | ||
823 | if (session->input) | 823 | if (session->input) { |
824 | hidp_setup_input(session, req); | 824 | err = hidp_setup_input(session, req); |
825 | if (err < 0) | ||
826 | goto failed; | ||
827 | } | ||
825 | 828 | ||
826 | if (session->hid) | 829 | if (session->hid) |
827 | hidp_setup_hid(session, req); | 830 | hidp_setup_hid(session, req); |