diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-05-26 21:54:27 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-05-26 21:54:27 -0400 |
commit | aa8f0dc6c3dbf1cf3ff58f3e945c981be134814d (patch) | |
tree | 3e343cd5493d442d1a26dc7a421422d84698831e /drivers/scsi/ata_piix.c | |
parent | bef9c558841604116704e10b3d9ff3dbf4939423 (diff) |
libata: Fix use-after-iounmap
Jens Axboe pointed out that the iounmap() call in libata was occurring
too early, and some drivers (ahci, probably others) were using ioremap'd
memory after it had been unmapped.
The patch should address that problem by way of improving the libata
driver API:
* move ->host_stop() call after all ->port_stop() calls have occurred.
* create default helper function ata_host_stop(), and move iounmap()
call there.
* add ->host_stop_prewalk() hook, use it in sata_qstor.c (hi Mark).
sata_qstor appears to require the host-stop-before-port-stop ordering
that existed prior to applying the attached patch.
Diffstat (limited to 'drivers/scsi/ata_piix.c')
-rw-r--r-- | drivers/scsi/ata_piix.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c index 3867f91ef8c..54c52349adc 100644 --- a/drivers/scsi/ata_piix.c +++ b/drivers/scsi/ata_piix.c | |||
@@ -153,6 +153,7 @@ static struct ata_port_operations piix_pata_ops = { | |||
153 | 153 | ||
154 | .port_start = ata_port_start, | 154 | .port_start = ata_port_start, |
155 | .port_stop = ata_port_stop, | 155 | .port_stop = ata_port_stop, |
156 | .host_stop = ata_host_stop, | ||
156 | }; | 157 | }; |
157 | 158 | ||
158 | static struct ata_port_operations piix_sata_ops = { | 159 | static struct ata_port_operations piix_sata_ops = { |
@@ -180,6 +181,7 @@ static struct ata_port_operations piix_sata_ops = { | |||
180 | 181 | ||
181 | .port_start = ata_port_start, | 182 | .port_start = ata_port_start, |
182 | .port_stop = ata_port_stop, | 183 | .port_stop = ata_port_stop, |
184 | .host_stop = ata_host_stop, | ||
183 | }; | 185 | }; |
184 | 186 | ||
185 | static struct ata_port_info piix_port_info[] = { | 187 | static struct ata_port_info piix_port_info[] = { |