Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Nov 2008 03:37:46 +0000 (UTC)
From:      Peter Wemm <peter@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185357 - head/sys/dev/ata
Message-ID:  <200811270337.mAR3bkcR074789@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: peter
Date: Thu Nov 27 03:37:46 2008
New Revision: 185357
URL: http://svn.freebsd.org/changeset/base/185357

Log:
  Don't let ata_completed() dereference a null request->dma pointer to
  print dma status after a media error.

Modified:
  head/sys/dev/ata/ata-queue.c

Modified: head/sys/dev/ata/ata-queue.c
==============================================================================
--- head/sys/dev/ata/ata-queue.c	Thu Nov 27 02:19:44 2008	(r185356)
+++ head/sys/dev/ata/ata-queue.c	Thu Nov 27 03:37:46 2008	(r185357)
@@ -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)))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811270337.mAR3bkcR074789>