diff options
Diffstat (limited to 'net/bluetooth/hidp/core.c')
| -rw-r--r-- | net/bluetooth/hidp/core.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index ccd985da6518..b2bcbe2dc328 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c | |||
| @@ -932,8 +932,12 @@ static int hidp_setup_hid(struct hidp_session *session, | |||
| 932 | hid->country = req->country; | 932 | hid->country = req->country; |
| 933 | 933 | ||
| 934 | strncpy(hid->name, req->name, 128); | 934 | strncpy(hid->name, req->name, 128); |
| 935 | strncpy(hid->phys, batostr(&bt_sk(session->ctrl_sock->sk)->src), 64); | 935 | |
| 936 | strncpy(hid->uniq, batostr(&bt_sk(session->ctrl_sock->sk)->dst), 64); | 936 | snprintf(hid->phys, sizeof(hid->phys), "%pMR", |
| 937 | &bt_sk(session->ctrl_sock->sk)->src); | ||
| 938 | |||
| 939 | snprintf(hid->uniq, sizeof(hid->uniq), "%pMR", | ||
| 940 | &bt_sk(session->ctrl_sock->sk)->dst); | ||
| 937 | 941 | ||
| 938 | hid->dev.parent = &session->conn->dev; | 942 | hid->dev.parent = &session->conn->dev; |
| 939 | hid->ll_driver = &hidp_hid_driver; | 943 | hid->ll_driver = &hidp_hid_driver; |
| @@ -941,6 +945,13 @@ static int hidp_setup_hid(struct hidp_session *session, | |||
| 941 | hid->hid_get_raw_report = hidp_get_raw_report; | 945 | hid->hid_get_raw_report = hidp_get_raw_report; |
| 942 | hid->hid_output_raw_report = hidp_output_raw_report; | 946 | hid->hid_output_raw_report = hidp_output_raw_report; |
| 943 | 947 | ||
| 948 | /* True if device is blacklisted in drivers/hid/hid-core.c */ | ||
| 949 | if (hid_ignore(hid)) { | ||
| 950 | hid_destroy_device(session->hid); | ||
| 951 | session->hid = NULL; | ||
| 952 | return -ENODEV; | ||
| 953 | } | ||
| 954 | |||
| 944 | return 0; | 955 | return 0; |
| 945 | 956 | ||
| 946 | fault: | 957 | fault: |
| @@ -1013,7 +1024,7 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, | |||
| 1013 | 1024 | ||
| 1014 | if (req->rd_size > 0) { | 1025 | if (req->rd_size > 0) { |
| 1015 | err = hidp_setup_hid(session, req); | 1026 | err = hidp_setup_hid(session, req); |
| 1016 | if (err) | 1027 | if (err && err != -ENODEV) |
| 1017 | goto purge; | 1028 | goto purge; |
| 1018 | } | 1029 | } |
| 1019 | 1030 | ||
