aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-hyperv.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2014-03-04 03:44:10 -0500
committerGrant Likely <grant.likely@linaro.org>2014-03-04 03:44:10 -0500
commitdab2310d9d90eded48625c5382c6a60389bf8ca9 (patch)
tree9327cc815d69dec23aebf03407e3fa82b6d2fbaa /drivers/hid/hid-hyperv.c
parenta3dbeb5b45af5b6113385db89fce2a8279278e8b (diff)
parent0414855fdc4a40da05221fc6062cccbc0c30f169 (diff)
Merge tag 'v3.14-rc5' into HEAD
Linux 3.14-rc5
Diffstat (limited to 'drivers/hid/hid-hyperv.c')
-rw-r--r--drivers/hid/hid-hyperv.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
index 8fae6d1414cc..c24908f14934 100644
--- a/drivers/hid/hid-hyperv.c
+++ b/drivers/hid/hid-hyperv.c
@@ -157,6 +157,7 @@ struct mousevsc_dev {
157 u32 report_desc_size; 157 u32 report_desc_size;
158 struct hv_input_dev_info hid_dev_info; 158 struct hv_input_dev_info hid_dev_info;
159 struct hid_device *hid_device; 159 struct hid_device *hid_device;
160 u8 input_buf[HID_MAX_BUFFER_SIZE];
160}; 161};
161 162
162 163
@@ -256,6 +257,7 @@ static void mousevsc_on_receive(struct hv_device *device,
256 struct synthhid_msg *hid_msg; 257 struct synthhid_msg *hid_msg;
257 struct mousevsc_dev *input_dev = hv_get_drvdata(device); 258 struct mousevsc_dev *input_dev = hv_get_drvdata(device);
258 struct synthhid_input_report *input_report; 259 struct synthhid_input_report *input_report;
260 size_t len;
259 261
260 pipe_msg = (struct pipe_prt_msg *)((unsigned long)packet + 262 pipe_msg = (struct pipe_prt_msg *)((unsigned long)packet +
261 (packet->offset8 << 3)); 263 (packet->offset8 << 3));
@@ -300,9 +302,12 @@ static void mousevsc_on_receive(struct hv_device *device,
300 (struct synthhid_input_report *)pipe_msg->data; 302 (struct synthhid_input_report *)pipe_msg->data;
301 if (!input_dev->init_complete) 303 if (!input_dev->init_complete)
302 break; 304 break;
303 hid_input_report(input_dev->hid_device, 305
304 HID_INPUT_REPORT, input_report->buffer, 306 len = min(input_report->header.size,
305 input_report->header.size, 1); 307 (u32)sizeof(input_dev->input_buf));
308 memcpy(input_dev->input_buf, input_report->buffer, len);
309 hid_input_report(input_dev->hid_device, HID_INPUT_REPORT,
310 input_dev->input_buf, len, 1);
306 break; 311 break;
307 default: 312 default:
308 pr_err("unsupported hid msg type - type %d len %d", 313 pr_err("unsupported hid msg type - type %d len %d",