svn commit: r192433 - head/sys/dev/ata/chipsets

Alexander Motin mav at FreeBSD.org
Wed May 20 09:44:33 UTC 2009


Author: mav
Date: Wed May 20 09:44:32 2009
New Revision: 192433
URL: http://svn.freebsd.org/changeset/base/192433

Log:
  Fix NULL dereference on Promise SX4 controllers, while executing commands
  that do not require data transfer (FLUSHCACHE).
  
  Tested by:	Magnus Kling <klingfon at gmail.com>
  MFC after:	1 week

Modified:
  head/sys/dev/ata/chipsets/ata-promise.c

Modified: head/sys/dev/ata/chipsets/ata-promise.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-promise.c	Wed May 20 08:32:25 2009	(r192432)
+++ head/sys/dev/ata/chipsets/ata-promise.c	Wed May 20 09:44:32 2009	(r192433)
@@ -1054,7 +1054,7 @@ ata_promise_sx4_command(struct ata_reque
     device_t gparent = GRANDPARENT(request->dev);
     struct ata_pci_controller *ctlr = device_get_softc(gparent);
     struct ata_channel *ch = device_get_softc(request->parent);
-    struct ata_dma_prdentry *prd = request->dma->sg;
+    struct ata_dma_prdentry *prd;
     caddr_t window = rman_get_virtual(ctlr->r_res1);
     u_int32_t *wordp;
     int i, idx, length = 0;
@@ -1098,6 +1098,7 @@ ata_promise_sx4_command(struct ata_reque
     case ATA_READ_DMA48:
     case ATA_WRITE_DMA:
     case ATA_WRITE_DMA48:
+	prd = request->dma->sg;
 	wordp = (u_int32_t *)
 	    (window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_HSG_OFFSET);
 	i = idx = 0;


More information about the svn-src-head mailing list