From 475a75abe5eec6df504762e58d6d6453958abda3 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Thu, 27 Nov 2008 03:37:46 +0000 Subject: [PATCH] Don't let ata_completed() dereference a null request->dma pointer to print dma status after a media error. --- sys/dev/ata/ata-queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ata/ata-queue.c b/sys/dev/ata/ata-queue.c index 9ca57b8c4770..c8ae79dce699 100644 --- a/sys/dev/ata/ata-queue.c +++ b/sys/dev/ata/ata-queue.c @@ -357,7 +357,7 @@ ata_completed(void *context, int dummy) "\6MEDIA_CHANGED\5NID_NOT_FOUND" "\4MEDIA_CHANGE_REQEST" "\3ABORTED\2NO_MEDIA\1ILLEGAL_LENGTH"); - if ((request->flags & ATA_R_DMA) && + if ((request->flags & ATA_R_DMA) && request->dma && (request->dma->status & ATA_BMSTAT_ERROR)) printf(" dma=0x%02x", request->dma->status); if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL)))