geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced

PR:		203499
Submitted by:	<chadf@triularity.org>
MFC after:	5 days
This commit is contained in:
Andriy Voskoboinyk 2019-01-26 14:54:06 +00:00
parent daeb432a7a
commit 34fd9d7000

View File

@ -889,13 +889,13 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp)
g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name);
g_topology_assert();
KASSERT(gp != NULL, ("NULL geom"));
if (gp->softc == NULL) {
DPRINTF(GUZ_DBG_ERR, ("%s(%s): gp->softc == NULL\n", __func__,
gp->name));
return (ENXIO);
}
KASSERT(gp != NULL, ("NULL geom"));
pp = LIST_FIRST(&gp->provider);
KASSERT(pp != NULL, ("NULL provider"));
if (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)