[PATCH 3/4] ide: filter out invalid transfer mode values in set_xfer_rate()
From: Bartlomiej Zolnierkiewicz
Date: Sat Jun 21 2008 - 15:23:57 EST
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@xxxxxxxxxxxxx>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
---
Sergei, IIRC that it is what you were suggesting some time ago.
drivers/ide/ide-proc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: b/drivers/ide/ide-proc.c
===================================================================
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -345,7 +345,7 @@ static int set_xfer_rate (ide_drive_t *d
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));
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/