summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchuck <chuck@cvs.openbsd.org>1996-01-13 03:52:46 +0000
committerchuck <chuck@cvs.openbsd.org>1996-01-13 03:52:46 +0000
commit3eefa793b27e584054bd97de48420773ee3cb2bb (patch)
treef177549b30b15398257122f286e330f78e3aa811
parentf406b38f13aa881e9c0357ce5905c8868e7acd38 (diff)
sync with sparc:
- move disk_attach() to before reading the disk label as per Jason. otherwise we are reading into an unallocated buffer (oops!)
-rw-r--r--sys/arch/sun3/dev/xd.c8
-rw-r--r--sys/arch/sun3/dev/xy.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/arch/sun3/dev/xd.c b/sys/arch/sun3/dev/xd.c
index 301373937af..3543a7c2d7e 100644
--- a/sys/arch/sun3/dev/xd.c
+++ b/sys/arch/sun3/dev/xd.c
@@ -36,7 +36,7 @@
* x d . c x y l o g i c s 7 5 3 / 7 0 5 3 v m e / s m d d r i v e r
*
* author: Chuck Cranor <chuck@ccrc.wustl.edu>
- * id: $Id: xd.c,v 1.2 1996/01/12 20:21:04 deraadt Exp $
+ * id: $Id: xd.c,v 1.3 1996/01/13 03:52:44 chuck Exp $
* started: 27-Feb-95
* references: [1] Xylogics Model 753 User's Manual
* part number: 166-753-001, Revision B, May 21, 1988.
@@ -632,6 +632,9 @@ xdattach(parent, self, aux)
newstate = XD_DRIVE_NOLABEL;
xd->hw_spt = spt;
+ /* Attach the disk: must be before getdisklabel to malloc label */
+ disk_attach(&xd->sc_dk);
+
if (xdgetdisklabel(xd, xa->dvmabuf) != XD_ERR_AOK)
goto done;
@@ -691,9 +694,6 @@ xdattach(parent, self, aux)
bcopy(xa->dvmabuf, &xd->dkb, XDFM_BPS);
}
- /* Attach the disk. */
- disk_attach(&xd->sc_dk);
-
/* XXX - Where is this and what does it do? -gwr */
dk_establish(&xd->sc_dk, &xd->sc_dev);
diff --git a/sys/arch/sun3/dev/xy.c b/sys/arch/sun3/dev/xy.c
index 527f96d7824..b369e2bca85 100644
--- a/sys/arch/sun3/dev/xy.c
+++ b/sys/arch/sun3/dev/xy.c
@@ -36,7 +36,7 @@
* x y . c x y l o g i c s 4 5 0 / 4 5 1 s m d d r i v e r
*
* author: Chuck Cranor <chuck@ccrc.wustl.edu>
- * id: $Id: xy.c,v 1.2 1996/01/12 20:21:06 deraadt Exp $
+ * id: $Id: xy.c,v 1.3 1996/01/13 03:52:45 chuck Exp $
* started: 14-Sep-95
* references: [1] Xylogics Model 753 User's Manual
* part number: 166-753-001, Revision B, May 21, 1988.
@@ -565,6 +565,9 @@ xyattach(parent, self, aux)
newstate = XY_DRIVE_NOLABEL;
xy->hw_spt = spt = 0; /* XXX needed ? */
+ /* Attach the disk: must be before getdisklabel to malloc label */
+ disk_attach(&xy->sc_dk);
+
if (xygetdisklabel(xy, xa->dvmabuf) != XY_ERR_AOK)
goto done;
@@ -653,9 +656,6 @@ xyattach(parent, self, aux)
bcopy(xa->dvmabuf, &xy->dkb, XYFM_BPS);
}
- /* Attach the disk. */
- disk_attach(&xy->sc_dk);
-
dk_establish(&xy->sc_dk, &xy->sc_dev); /* XXX */
done: