diff options
Diffstat (limited to 'net')
| -rw-r--r-- | net/bluetooth/hidp/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index 26f0d109ff41..a859f9078df6 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c | |||
| @@ -842,6 +842,8 @@ static int hidp_setup_input(struct hidp_session *session, | |||
| 842 | 842 | ||
| 843 | err = input_register_device(input); | 843 | err = input_register_device(input); |
| 844 | if (err < 0) { | 844 | if (err < 0) { |
| 845 | input_free_device(input); | ||
| 846 | session->input = NULL; | ||
| 845 | hci_conn_put_device(session->conn); | 847 | hci_conn_put_device(session->conn); |
| 846 | return err; | 848 | return err; |
| 847 | } | 849 | } |
| @@ -1089,7 +1091,6 @@ purge: | |||
| 1089 | failed: | 1091 | failed: |
| 1090 | up_write(&hidp_session_sem); | 1092 | up_write(&hidp_session_sem); |
| 1091 | 1093 | ||
| 1092 | input_free_device(session->input); | ||
| 1093 | kfree(session); | 1094 | kfree(session); |
| 1094 | return err; | 1095 | return err; |
| 1095 | } | 1096 | } |
