summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/geom/geom_disk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 87ae2ad..7145c0d 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -404,7 +404,9 @@ disk_destroy(struct disk *dp)
g_cancel_event(dp);
dp->d_destroyed = 1;
- g_post_event(g_disk_destroy, dp, M_WAITOK, NULL);
+ if (dp->d_devstat != NULL)
+ devstat_remove_entry(dp->d_devstat);
+ g_post_event(g_disk_destroy, dp, M_WAITOK, NULL, NULL);
}
static void
OpenPOWER on IntegriCloud