diff options
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r-- | drivers/ide/ide-taskfile.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 1d0470c1f957..30175c7688e8 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -524,8 +524,8 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) | |||
524 | task_ioreg_t *hobsptr = args.hobRegister; | 524 | task_ioreg_t *hobsptr = args.hobRegister; |
525 | int err = 0; | 525 | int err = 0; |
526 | int tasksize = sizeof(struct ide_task_request_s); | 526 | int tasksize = sizeof(struct ide_task_request_s); |
527 | int taskin = 0; | 527 | unsigned int taskin = 0; |
528 | int taskout = 0; | 528 | unsigned int taskout = 0; |
529 | u8 io_32bit = drive->io_32bit; | 529 | u8 io_32bit = drive->io_32bit; |
530 | char __user *buf = (char __user *)arg; | 530 | char __user *buf = (char __user *)arg; |
531 | 531 | ||
@@ -538,8 +538,13 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) | |||
538 | return -EFAULT; | 538 | return -EFAULT; |
539 | } | 539 | } |
540 | 540 | ||
541 | taskout = (int) req_task->out_size; | 541 | taskout = req_task->out_size; |
542 | taskin = (int) req_task->in_size; | 542 | taskin = req_task->in_size; |
543 | |||
544 | if (taskin > 65536 || taskout > 65536) { | ||
545 | err = -EINVAL; | ||
546 | goto abort; | ||
547 | } | ||
543 | 548 | ||
544 | if (taskout) { | 549 | if (taskout) { |
545 | int outtotal = tasksize; | 550 | int outtotal = tasksize; |