Skip to content

Commit

Permalink
Staging: hv: mousevsc: Handle the case where we may get bogus report …
Browse files Browse the repository at this point in the history
…desc size

Handle the case where we may get bogus report desc size from the host.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Oct 4, 2011
1 parent 0158489 commit 60e8615
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/hv/hv_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,

/* Save the report desc */
input_device->report_desc_size = desc->desc[0].wDescriptorLength;
if (input_device->report_desc_size == 0)
goto cleanup;
input_device->report_desc = kzalloc(input_device->report_desc_size,
GFP_ATOMIC);

Expand Down

0 comments on commit 60e8615

Please sign in to comment.