diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2011-09-29 18:54:45 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-04 17:39:32 (GMT) |
commit | 60e8615ad6e09f47b15c4d023f728c112b8f7294 (patch) | |
tree | 7e29a9841338828a7506767b3c428875bee6e9ea /drivers/staging/hv | |
parent | 01584892dbf915a3921c5fc2607363e07023ef5c (diff) | |
download | linux-60e8615ad6e09f47b15c4d023f728c112b8f7294.tar.xz |
Staging: hv: mousevsc: Handle the case where we may get bogus report 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>
Diffstat (limited to 'drivers/staging/hv')
-rw-r--r-- | drivers/staging/hv/hv_mouse.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c index b7cc164..19cfc23 100644 --- a/drivers/staging/hv/hv_mouse.c +++ b/drivers/staging/hv/hv_mouse.c @@ -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); |