summaryrefslogtreecommitdiff
path: root/sys/kern/subr_disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r--sys/kern/subr_disk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index fa5eff913707..cf1b3ccab8cf 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -88,12 +88,15 @@ disk_dumpcheck(dev_t dev, u_int *count, u_int *blkno, u_int *secsize)
void
disk_invalidate (struct disk *disk)
{
- dsgone(&disk->d_slice);
+ if (disk->d_slice)
+ dsgone(&disk->d_slice);
}
void
disk_destroy(dev_t dev)
{
+ dev->si_disk = NULL;
+ destroy_dev(dev);
return;
}