]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ide: filter out invalid transfer mode values in set_xfer_rate()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 23 Jul 2008 17:55:55 +0000 (19:55 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 23 Jul 2008 17:55:55 +0000 (19:55 +0200)
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>
drivers/ide/ide-proc.c

index 8af88bf0969bde8bf41926e1e5834deed20022f6..54d57a15d59eb3dac55dab7259ffd2a24cfff641 100644 (file)
@@ -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));