mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 06:50:43 -04:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
01584892db
commit
60e8615ad6
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user