summaryrefslogtreecommitdiffstats
path: root/sys/geom/mountver
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2011-05-04 18:17:21 +0000
committerae <ae@FreeBSD.org>2011-05-04 18:17:21 +0000
commita7dee41b129ba44b4c8c935b3d92b70c8c22aba6 (patch)
tree6b84e3b54c9dbed998819d9191882a22eca92bf7 /sys/geom/mountver
parentd357ee3b9f3f9bf684a578943792d93ff6488501 (diff)
downloadFreeBSD-src-a7dee41b129ba44b4c8c935b3d92b70c8c22aba6.zip
FreeBSD-src-a7dee41b129ba44b4c8c935b3d92b70c8c22aba6.tar.gz
Remove unneeded code.
MFC after: 1 week
Diffstat (limited to 'sys/geom/mountver')
-rw-r--r--sys/geom/mountver/g_mountver.c35
1 files changed, 7 insertions, 28 deletions
diff --git a/sys/geom/mountver/g_mountver.c b/sys/geom/mountver/g_mountver.c
index bf2e8a6..c653090 100644
--- a/sys/geom/mountver/g_mountver.c
+++ b/sys/geom/mountver/g_mountver.c
@@ -248,10 +248,6 @@ g_mountver_create(struct gctl_req *req, struct g_class *mp, struct g_provider *p
}
}
gp = g_new_geomf(mp, name);
- if (gp == NULL) {
- gctl_error(req, "Cannot create geom %s.", name);
- return (ENOMEM);
- }
sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
mtx_init(&sc->sc_mtx, "gmountver", NULL, MTX_DEF);
TAILQ_INIT(&sc->sc_queue);
@@ -263,20 +259,10 @@ g_mountver_create(struct gctl_req *req, struct g_class *mp, struct g_provider *p
gp->dumpconf = g_mountver_dumpconf;
newpp = g_new_providerf(gp, gp->name);
- if (newpp == NULL) {
- gctl_error(req, "Cannot create provider %s.", name);
- error = ENOMEM;
- goto fail;
- }
newpp->mediasize = pp->mediasize;
newpp->sectorsize = pp->sectorsize;
cp = g_new_consumer(gp);
- if (cp == NULL) {
- gctl_error(req, "Cannot create consumer for %s.", gp->name);
- error = ENOMEM;
- goto fail;
- }
error = g_attach(cp, pp);
if (error != 0) {
gctl_error(req, "Cannot attach to provider %s.", pp->name);
@@ -303,20 +289,13 @@ g_mountver_create(struct gctl_req *req, struct g_class *mp, struct g_provider *p
G_MOUNTVER_DEBUG(0, "Device %s created.", gp->name);
return (0);
fail:
- if (sc->sc_provider_name != NULL)
- g_free(sc->sc_provider_name);
- if (cp != NULL) {
- if (cp->provider != NULL)
- g_detach(cp);
- g_destroy_consumer(cp);
- }
- if (newpp != NULL)
- g_destroy_provider(newpp);
- if (gp != NULL) {
- if (gp->softc != NULL)
- g_free(gp->softc);
- g_destroy_geom(gp);
- }
+ g_free(sc->sc_provider_name);
+ if (cp->provider != NULL)
+ g_detach(cp);
+ g_destroy_consumer(cp);
+ g_destroy_provider(newpp);
+ g_free(gp->softc);
+ g_destroy_geom(gp);
return (error);
}
OpenPOWER on IntegriCloud