From 3ac6c13bd445f49aca8d45ca212d2003f5b98052 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Wed, 11 May 2005 19:36:56 +0000 Subject: [PATCH] cp can't be NULL. Noticed by: Coverity Prevent analysis tool --- sys/geom/raid3/g_raid3_ctl.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/geom/raid3/g_raid3_ctl.c b/sys/geom/raid3/g_raid3_ctl.c index a38f007fc15..2edbe46da02 100644 --- a/sys/geom/raid3/g_raid3_ctl.c +++ b/sys/geom/raid3/g_raid3_ctl.c @@ -459,13 +459,11 @@ g_raid3_ctl_insert(struct gctl_req *req, struct g_class *mp) if (error != 0) gctl_error(req, "Cannot store metadata on %s.", pp->name); end: - if (cp != NULL) { - if (cp->acw > 0) - g_access(cp, 0, -1, -1); - if (cp->provider != NULL) - g_detach(cp); - g_destroy_consumer(cp); - } + if (cp->acw > 0) + g_access(cp, 0, -1, -1); + if (cp->provider != NULL) + g_detach(cp); + g_destroy_consumer(cp); g_destroy_geom(gp); }