From c30daac190de23779090c645e680c7977377032c Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Wed, 23 Jul 2008 19:55:55 +0200 Subject: [PATCH] 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 Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index 8af88bf096..54d57a15d5 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)); -- 2.39.5