aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/ozwpan/ozusbsvc1.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/ozwpan/ozusbsvc1.c b/drivers/staging/ozwpan/ozusbsvc1.c
index 7b13dc910172..f660bb198c65 100644
--- a/drivers/staging/ozwpan/ozusbsvc1.c
+++ b/drivers/staging/ozwpan/ozusbsvc1.c
@@ -326,10 +326,11 @@ static void oz_usb_handle_ep_data(struct oz_usb_ctx *usb_ctx,
326 struct oz_multiple_fixed *body = 326 struct oz_multiple_fixed *body =
327 (struct oz_multiple_fixed *)data_hdr; 327 (struct oz_multiple_fixed *)data_hdr;
328 u8 *data = body->data; 328 u8 *data = body->data;
329 int n; 329 unsigned int n;
330 if (!body->unit_size) 330 if (!body->unit_size ||
331 len < sizeof(struct oz_multiple_fixed) - 1)
331 break; 332 break;
332 n = (len - sizeof(struct oz_multiple_fixed)+1) 333 n = (len - (sizeof(struct oz_multiple_fixed) - 1))
333 / body->unit_size; 334 / body->unit_size;
334 while (n--) { 335 while (n--) {
335 oz_hcd_data_ind(usb_ctx->hport, body->endpoint, 336 oz_hcd_data_ind(usb_ctx->hport, body->endpoint,