diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 7b894a035d18..597d2daf4543 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -47,7 +47,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.147 1999/06/26 02:46:52 mckusick Exp $ + * $Id: fd.c,v 1.148 1999/07/04 14:58:32 phk Exp $ * */ @@ -2127,6 +2127,9 @@ retrier(struct fdc_data *fdc) fail: { dev_t sav_b_dev = bp->b_dev; + + if (fdc->fd == 0) + goto bogus; /* Trick diskerr */ bp->b_dev = makedev(major(bp->b_dev), (FDUNIT(minor(bp->b_dev))<<3)|RAW_PART); @@ -2160,6 +2163,7 @@ retrier(struct fdc_data *fdc) DEVSTAT_WRITE); fdc->fd->skip = 0; biodone(bp); + bogus: fdc->state = FINDWORK; fdc->flags |= FDC_NEEDS_RESET; fdc->fd = (fd_p) 0; diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 7b894a035d18..597d2daf4543 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -47,7 +47,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.147 1999/06/26 02:46:52 mckusick Exp $ + * $Id: fd.c,v 1.148 1999/07/04 14:58:32 phk Exp $ * */ @@ -2127,6 +2127,9 @@ retrier(struct fdc_data *fdc) fail: { dev_t sav_b_dev = bp->b_dev; + + if (fdc->fd == 0) + goto bogus; /* Trick diskerr */ bp->b_dev = makedev(major(bp->b_dev), (FDUNIT(minor(bp->b_dev))<<3)|RAW_PART); @@ -2160,6 +2163,7 @@ retrier(struct fdc_data *fdc) DEVSTAT_WRITE); fdc->fd->skip = 0; biodone(bp); + bogus: fdc->state = FINDWORK; fdc->flags |= FDC_NEEDS_RESET; fdc->fd = (fd_p) 0;