diff options
author | joerg <joerg@FreeBSD.org> | 1999-07-21 12:19:44 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1999-07-21 12:19:44 +0000 |
commit | cb38f4c0262e56c486e51b7edc89f021ae684d1a (patch) | |
tree | ab71ba511af92a15f8616b1bd657910d76d954cd /sys/isa | |
parent | c292b216c3ddfc3e30f5fa42a68ae0f9b6972814 (diff) | |
download | FreeBSD-src-cb38f4c0262e56c486e51b7edc89f021ae684d1a.zip FreeBSD-src-cb38f4c0262e56c486e51b7edc89f021ae684d1a.tar.gz |
Hack to work around a NULL pointer dereferencation that can be triggered
by removing a floppy that as being operated on.
The spagghetti is hardly understandable at all anymore, so i can't
100 % ascertain this is really the Right Thing to do, maybe our new
floppy driver maintainer, Jesus Monroy Jr can do this. :-))
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/fd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 7b894a0..597d2da 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; |