From 60e8615ad6e09f47b15c4d023f728c112b8f7294 Mon Sep 17 00:00:00 2001 From: "K. Y. Srinivasan" Date: Thu, 29 Sep 2011 11:54:45 -0700 Subject: [PATCH] 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 Signed-off-by: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hv/hv_mouse.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.7.4