From 7afc4431e744190da42a8cf580f172c547a9d7ab Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 10 Jul 1996 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1996-07-10 --- port/devsd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/port/devsd.c b/port/devsd.c index 9aa663300b022135b814deea5b127d947b9bc229..4cf12054e3702565304b62517d9a3abc9b13dee3 100644 --- a/port/devsd.c +++ b/port/devsd.c @@ -103,10 +103,11 @@ void sdinit(void) { Disk *d; - uchar scratch[0xFF], type; + uchar *scratch, type; int dev, i, nbytes; dev = 0; + scratch = scsialloc(0xFF); for(;;) { d = &disk[ndisk]; dev = scsiinv(dev, types, &d->t, &d->inquire, d->id); @@ -124,7 +125,7 @@ sdinit(void) * the peripheral device type and qualifier fields * in the response to an inquiry command are 0x7F. */ - nbytes = sizeof(scratch); + nbytes = 0xFF; memset(scratch, 0, nbytes); if(scsiinquiry(d->t, d->lun, scratch, &nbytes) != STok) continue; @@ -179,6 +180,7 @@ sdinit(void) break; } } + scsifree(scratch); } Chan*