PERFORCE change 168509 for review

Alexander Motin mav at FreeBSD.org
Sun Sep 13 17:29:06 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=168509

Change 168509 by mav at mav_mavtest on 2009/09/13 17:28:22

	Fill request->parent before calling ata_modify_if_48bit().

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/dev/ata/ata-queue.c#19 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/dev/ata/ata-queue.c#19 (text+ko) ====

@@ -59,19 +59,18 @@
 
     /* Prepare paramers required by low-level code. */
     request->unit = atadev->unit;
+    if (!(request->parent = device_get_parent(request->dev))) {
+	request->result = ENXIO;
+	if (request->callback)
+	    (request->callback)(request);
+	return;
+    }
     if ((atadev->param.config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_16)
 	request->flags |= ATA_R_ATAPI16;
     if ((atadev->param.config & ATA_DRQ_MASK) == ATA_DRQ_INTR)
 	request->flags |= ATA_R_ATAPI_INTR;
     if ((request->flags & ATA_R_ATAPI) == 0)
 	ata_modify_if_48bit(request);
-    /* check that the device is still valid */
-    if (!(request->parent = device_get_parent(request->dev))) {
-	request->result = ENXIO;
-	if (request->callback)
-	    (request->callback)(request);
-	return;
-    }
     ch = device_get_softc(request->parent);
     callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED);
     if (!request->callback && !(request->flags & ATA_R_REQUEUE))


More information about the p4-projects mailing list