We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04bf464 commit 9a59029Copy full SHA for 9a59029
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 =
327
(struct oz_multiple_fixed *)data_hdr;
328
u8 *data = body->data;
329
- int n;
330
- if (!body->unit_size)
+ unsigned int n;
+ if (!body->unit_size ||
331
+ len < sizeof(struct oz_multiple_fixed) - 1)
332
break;
- n = (len - sizeof(struct oz_multiple_fixed)+1)
333
+ n = (len - (sizeof(struct oz_multiple_fixed) - 1))
334
/ body->unit_size;
335
while (n--) {
336
oz_hcd_data_ind(usb_ctx->hport, body->endpoint,
0 commit comments