summaryrefslogtreecommitdiffstats
path: root/sys/isa
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-09-13 11:37:38 +0000
committerphk <phk@FreeBSD.org>2002-09-13 11:37:38 +0000
commitc7f7c94e96a3ca3b6ee08f2709863c82e301de41 (patch)
treed86f17f2f7d1c86eb8925dedbc683bfcd1a58c30 /sys/isa
parent725daf0b2d98322fdc86d273333bdbc9b7d1a526 (diff)
downloadFreeBSD-src-c7f7c94e96a3ca3b6ee08f2709863c82e301de41.zip
FreeBSD-src-c7f7c94e96a3ca3b6ee08f2709863c82e301de41.tar.gz
Fix a bug were a struct bio was freed and certain members subsequently
examined. Use biowait() instead of DIY.
Diffstat (limited to 'sys/isa')
-rw-r--r--sys/isa/fd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/isa/fd.c b/sys/isa/fd.c
index 68786b6..1dfa399 100644
--- a/sys/isa/fd.c
+++ b/sys/isa/fd.c
@@ -2561,6 +2561,7 @@ fdmisccmd(dev_t dev, u_int cmd, void *data)
struct fd_formb *finfo;
struct fdc_readid *idfield;
size_t fdblk;
+ int error;
fdu = FDUNIT(minor(dev));
fd = devclass_get_softc(fd_devclass, fdu);
@@ -2602,11 +2603,9 @@ fdmisccmd(dev_t dev, u_int cmd, void *data)
* for the current context.
*/
fdstrategy(bp);
- while ((bp->bio_flags & BIO_DONE) == 0)
- tsleep(bp, PRIBIO, "fdcmd", 0);
-
+ error = biowait(bp, "fdcmd");
free(bp, M_TEMP);
- return (bp->bio_flags & BIO_ERROR ? bp->bio_error : 0);
+ return (error);
}
static int
OpenPOWER on IntegriCloud