sync with sparc:

- move disk_attach() to before reading the disk label as per Jason.
	otherwise we are reading into an unallocated buffer (oops!)
This commit is contained in:
chuck 1996-01-13 03:50:05 +00:00
parent ef895a47d4
commit 8f339409b7
2 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: xd.c,v 1.2 1996/01/07 22:03:17 thorpej Exp $ */
/* $NetBSD: xd.c,v 1.3 1996/01/13 03:50:05 chuck Exp $ */
/*
*
@ -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/07 22:03:17 thorpej Exp $
* id: $Id: xd.c,v 1.3 1996/01/13 03:50:05 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);

View File

@ -1,4 +1,4 @@
/* $NetBSD: xy.c,v 1.2 1996/01/07 22:03:20 thorpej Exp $ */
/* $NetBSD: xy.c,v 1.3 1996/01/13 03:50:09 chuck Exp $ */
/*
*
@ -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/07 22:03:20 thorpej Exp $
* id: $Id: xy.c,v 1.3 1996/01/13 03:50:09 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: