diff options
author | le <le@FreeBSD.org> | 2004-03-11 14:11:08 +0000 |
---|---|---|
committer | le <le@FreeBSD.org> | 2004-03-11 14:11:08 +0000 |
commit | b4f24d501388e451effb83554929f95bd6883301 (patch) | |
tree | b920656e7953ccc2eb1688a8f901cc3c3d23fd62 /sys/dev/vinum/vinumconfig.c | |
parent | 7ad97e57ad3c487fa3acbe425df6e2756c27e563 (diff) | |
download | FreeBSD-src-b4f24d501388e451effb83554929f95bd6883301.zip FreeBSD-src-b4f24d501388e451effb83554929f95bd6883301.tar.gz |
Properly count references of our dev_t to avoid triggering a KASSERT in
dev_strategy().
Submitted by: dwmalone
Approved by: grog (mentor)
Diffstat (limited to 'sys/dev/vinum/vinumconfig.c')
-rw-r--r-- | sys/dev/vinum/vinumconfig.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/vinum/vinumconfig.c b/sys/dev/vinum/vinumconfig.c index e622eb1..8c7e038 100644 --- a/sys/dev/vinum/vinumconfig.c +++ b/sys/dev/vinum/vinumconfig.c @@ -476,6 +476,7 @@ get_empty_drive(void) bzero(drive, sizeof(struct drive)); drive->driveno = driveno; /* put number in structure */ drive->flags |= VF_NEWBORN; /* newly born drive */ + drive->dev = NODEV; strcpy(drive->devicename, "unknown"); /* and make the name ``unknown'' */ return driveno; /* return the index */ } @@ -594,6 +595,8 @@ free_drive(struct drive *drive) close_locked_drive(drive); /* close it */ if (drive->freelist) Free(drive->freelist); + if (drive->dev != NODEV) + dev_rel(drive->dev); bzero(drive, sizeof(struct drive)); /* this also sets drive_unallocated */ unlockdrive(drive); } |