Skip to content

Commit

Permalink
ide: filter out invalid transfer mode values in set_xfer_rate()
Browse files Browse the repository at this point in the history
Filter out invalid transfer mode values (0x02-0x07) in write handler
for obsoleted /proc/ide/hd?/settings:current_speed setting.

While at it:

* Use XFER_UDMA_6 define.

Suggested-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jul 23, 2008
1 parent ba4b2e6 commit c30daac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ide/ide-proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static int set_xfer_rate (ide_drive_t *drive, int arg)
ide_task_t task;
int err;

if (arg < 0 || arg > 70)
if (arg < 0 || (arg > 1 && arg < XFER_PIO_0) || arg > XFER_UDMA_6)
return -EINVAL;

memset(&task, 0, sizeof(task));
Expand Down

0 comments on commit c30daac

Please sign in to comment.