From 0a654fd8aa19107d0907864ed200c3c5d650fc5f Mon Sep 17 00:00:00 2001 From: chuck Date: Sat, 13 Jan 1996 03:52:44 +0000 Subject: [PATCH] sync with sparc: - move disk_attach() to before reading the disk label as per Jason. otherwise we are reading into an unallocated buffer (oops!) --- sys/arch/sun3/dev/xd.c | 8 ++++---- sys/arch/sun3/dev/xy.c | 8 ++++---- 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 - * 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 - * 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: -- 2.20.1