diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-01-04 10:23:29 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-03-24 15:56:45 -0400 |
commit | 5d3fd692a7196a9045fb606f891f5987959b65a0 (patch) | |
tree | f5dd0b2db4171ea05c70035e29b2cc7ff7f82850 /drivers/firewire | |
parent | 1566f3dc3e5986a16c7bbb3bb95bb691251a8d25 (diff) |
firewire: cdev: extend transaction payload size check
Make the size check of ioctl_send_request and
ioctl_send_broadcast_request speed dependent. Also change the error
return code from -EINVAL to -EIO to distinguish this from other errors
concerning the ioctl parameters.
Another payload size limit for which we don't check here though is the
remote node's Bus_Info_Block.max_rec.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire')
-rw-r--r-- | drivers/firewire/fw-cdev.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c index d48fa1c23a77..6b33f15584cb 100644 --- a/drivers/firewire/fw-cdev.c +++ b/drivers/firewire/fw-cdev.c | |||
@@ -525,9 +525,8 @@ static int init_request(struct client *client, | |||
525 | struct outbound_transaction_event *e; | 525 | struct outbound_transaction_event *e; |
526 | int ret; | 526 | int ret; |
527 | 527 | ||
528 | /* What is the biggest size we'll accept, really? */ | 528 | if (request->length > 4096 || request->length > 512 << speed) |
529 | if (request->length > 4096) | 529 | return -EIO; |
530 | return -EINVAL; | ||
531 | 530 | ||
532 | e = kmalloc(sizeof(*e) + request->length, GFP_KERNEL); | 531 | e = kmalloc(sizeof(*e) + request->length, GFP_KERNEL); |
533 | if (e == NULL) | 532 | if (e == NULL) |