diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:55 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:55 -0400 |
commit | c30daac190de23779090c645e680c7977377032c (patch) | |
tree | c2169a32701d1da7271d6635c347f30f7bfa1985 /drivers/ide/ide-proc.c | |
parent | ba4b2e607e4e9eaa929935325dafd5c86d3b5262 (diff) |
ide: filter out invalid transfer mode values in set_xfer_rate()
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>
Diffstat (limited to 'drivers/ide/ide-proc.c')
-rw-r--r-- | drivers/ide/ide-proc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index 8af88bf0969b..54d57a15d59e 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c | |||
@@ -345,7 +345,7 @@ static int set_xfer_rate (ide_drive_t *drive, int arg) | |||
345 | ide_task_t task; | 345 | ide_task_t task; |
346 | int err; | 346 | int err; |
347 | 347 | ||
348 | if (arg < 0 || arg > 70) | 348 | if (arg < 0 || (arg > 1 && arg < XFER_PIO_0) || arg > XFER_UDMA_6) |
349 | return -EINVAL; | 349 | return -EINVAL; |
350 | 350 | ||
351 | memset(&task, 0, sizeof(task)); | 351 | memset(&task, 0, sizeof(task)); |