From 2a65f27c4f5c24a39c46f9a808d9858cd23d0248 Mon Sep 17 00:00:00 2001 From: pjd Date: Thu, 5 Aug 2004 14:07:21 +0000 Subject: [PATCH] Don't use 'bp' after its destruction! --- sys/geom/mirror/g_mirror.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 6b3a67f3269d..1ba1bc84e9f7 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -984,10 +984,9 @@ g_mirror_sync_request(struct bio *bp) return; } G_MIRROR_LOGREQ(3, bp, "Synchronization request finished."); - g_destroy_bio(bp); disk->d_sync.ds_offset_done = bp->bio_offset + bp->bio_length; - if (bp->bio_offset + bp->bio_length == - sc->sc_provider->mediasize) { + g_destroy_bio(bp); + if (disk->d_sync.ds_offset_done == sc->sc_provider->mediasize) { /* * Disk up-to-date, activate it. */