summaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-01-21 14:06:42 +0100
committerDavid S. Miller <davem@davemloft.net>2020-01-30 11:03:24 +0100
commit2fd3c5c617937cde5aafa48db4f4056e1f705987 (patch)
tree05bece251a79b561d0e2734117ea2532233e2bc8 /drivers/ide
parentide: serverworks: potential overflow in svwks_set_pio_mode() (diff)
downloadlinux-2fd3c5c617937cde5aafa48db4f4056e1f705987.tar.xz
linux-2fd3c5c617937cde5aafa48db4f4056e1f705987.zip
ide: make drive->dn read only
The IDE core always sets ->dn correctly so changing it is never required. Setting it to a different value than assigned by IDE core is very likely to result in data corruption (due to wrong transfer timings being set on the controller etc.) Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Tested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ide')
-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 0363d73b0be0..e73016cbd406 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -206,7 +206,7 @@ static int set_xfer_rate (ide_drive_t *drive, int arg)
ide_devset_rw(current_speed, xfer_rate);
ide_devset_rw_field(init_speed, init_speed);
ide_devset_rw_flag(nice1, IDE_DFLAG_NICE1);
-ide_devset_rw_field(number, dn);
+ide_devset_ro_field(number, dn);
static const struct ide_proc_devset ide_generic_settings[] = {
IDE_PROC_DEVSET(current_speed, 0, 70),