summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 19:55:55 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 19:55:55 +0200
commitc30daac190de23779090c645e680c7977377032c (patch)
treec2169a32701d1da7271d6635c347f30f7bfa1985
parentba4b2e607e4e9eaa929935325dafd5c86d3b5262 (diff)
downloadlinux-c30daac190de23779090c645e680c7977377032c.tar.bz2
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>
-rw-r--r--drivers/ide/ide-proc.c2
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)
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));