aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ata/ata-lowlevel.c
diff options
context:
space:
mode:
authorNate Lawson <njl@FreeBSD.org>2004-08-06 22:23:53 +0000
committerNate Lawson <njl@FreeBSD.org>2004-08-06 22:23:53 +0000
commitc68afc9d21d0dfb5c854e7969d90e6be00e77cbd (patch)
treebdc33355f0797767465054c8013a200106662d52 /sys/dev/ata/ata-lowlevel.c
parentcc701b73b80497100a363d496cc881405ee66129 (diff)
downloadsrc-c68afc9d21d0dfb5c854e7969d90e6be00e77cbd.tar.gz
src-c68afc9d21d0dfb5c854e7969d90e6be00e77cbd.zip
Fix a panic in ata_generic_transaction(). The DMA pointer of the channel
was being unconditionally dereferenced but was NULL for PIO requests. Check the request flags for a DMA transaction before dereferencing. Reported by: ceri Tested by: Radek Kozlowski <radek -at- raadradd.com>
Notes
Notes: svn path=/head/; revision=133235
Diffstat (limited to 'sys/dev/ata/ata-lowlevel.c')
-rw-r--r--sys/dev/ata/ata-lowlevel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/ata/ata-lowlevel.c b/sys/dev/ata/ata-lowlevel.c
index e305085f03e2..e5589e4760f7 100644
--- a/sys/dev/ata/ata-lowlevel.c
+++ b/sys/dev/ata/ata-lowlevel.c
@@ -295,7 +295,7 @@ ata_generic_transaction(struct ata_request *request)
}
/* request finish here */
- if (ch->dma->flags & ATA_DMA_LOADED)
+ if (request->flags & ATA_R_DMA && ch->dma->flags & ATA_DMA_LOADED)
ch->dma->unload(ch);
return ATA_OP_FINISHED;
}