diff options
Diffstat (limited to 'drivers/firewire/fw-device-cdev.c')
-rw-r--r-- | drivers/firewire/fw-device-cdev.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/firewire/fw-device-cdev.c b/drivers/firewire/fw-device-cdev.c index 7b0efccf78f1..be6bfcfb9065 100644 --- a/drivers/firewire/fw-device-cdev.c +++ b/drivers/firewire/fw-device-cdev.c | |||
@@ -541,20 +541,32 @@ static int ioctl_create_iso_context(struct client *client, void __user *arg) | |||
541 | if (copy_from_user(&request, arg, sizeof request)) | 541 | if (copy_from_user(&request, arg, sizeof request)) |
542 | return -EFAULT; | 542 | return -EFAULT; |
543 | 543 | ||
544 | if (request.type > FW_ISO_CONTEXT_RECEIVE) | ||
545 | return -EINVAL; | ||
546 | |||
547 | if (request.channel > 63) | 544 | if (request.channel > 63) |
548 | return -EINVAL; | 545 | return -EINVAL; |
549 | 546 | ||
550 | if (request.sync > 15) | 547 | switch (request.type) { |
551 | return -EINVAL; | 548 | case FW_ISO_CONTEXT_RECEIVE: |
549 | if (request.sync > 15) | ||
550 | return -EINVAL; | ||
552 | 551 | ||
553 | if (request.tags == 0 || request.tags > 15) | 552 | if (request.tags == 0 || request.tags > 15) |
554 | return -EINVAL; | 553 | return -EINVAL; |
554 | |||
555 | if (request.header_size < 4 || (request.header_size & 3)) | ||
556 | return -EINVAL; | ||
555 | 557 | ||
556 | if (request.speed > SCODE_3200) | 558 | break; |
559 | |||
560 | case FW_ISO_CONTEXT_TRANSMIT: | ||
561 | if (request.speed > SCODE_3200) | ||
562 | return -EINVAL; | ||
563 | |||
564 | break; | ||
565 | |||
566 | default: | ||
557 | return -EINVAL; | 567 | return -EINVAL; |
568 | } | ||
569 | |||
558 | 570 | ||
559 | client->iso_context = fw_iso_context_create(client->device->card, | 571 | client->iso_context = fw_iso_context_create(client->device->card, |
560 | request.type, | 572 | request.type, |