summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2010-06-05 08:00:52 +0000
committertrasz <trasz@FreeBSD.org>2010-06-05 08:00:52 +0000
commitb0cd47b6029de92b06b4f70ec78b0e05f4ea7b8e (patch)
tree4f486c4a003dc52000df2989a122099a5655b25b
parent46a01349e962e8ad2ff008a223638581fa4aeefb (diff)
downloadFreeBSD-src-b0cd47b6029de92b06b4f70ec78b0e05f4ea7b8e.zip
FreeBSD-src-b0cd47b6029de92b06b4f70ec78b0e05f4ea7b8e.tar.gz
Make sure not to pass NULL to g_orphan_provider().
Found with: Coverity Prevent CID: 3411
-rw-r--r--sys/geom/mountver/g_mountver.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/geom/mountver/g_mountver.c b/sys/geom/mountver/g_mountver.c
index e15ce9d..bf2e8a6 100644
--- a/sys/geom/mountver/g_mountver.c
+++ b/sys/geom/mountver/g_mountver.c
@@ -343,7 +343,8 @@ g_mountver_destroy(struct g_geom *gp, boolean_t force)
} else {
G_MOUNTVER_DEBUG(0, "Device %s removed.", gp->name);
}
- g_orphan_provider(pp, ENXIO);
+ if (pp != NULL)
+ g_orphan_provider(pp, ENXIO);
g_mountver_discard_queued(gp);
g_free(sc->sc_provider_name);
g_free(gp->softc);
OpenPOWER on IntegriCloud