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>
This commit is contained in:
Nate Lawson 2004-08-06 22:23:53 +00:00
parent cc701b73b8
commit c68afc9d21
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=133235

View file

@ -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;
}