From 6c56e6840758237a2c27083520114135532926f6 Mon Sep 17 00:00:00 2001 From: avos Date: Thu, 31 Jan 2019 11:36:28 +0000 Subject: [PATCH] MFC r343473: geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced PR: 203499 Submitted by: MFC r343475: geom_uzip(4): set 'gp != NULL' assertion on top of the function There was yet another access to this variable in g_trace() few lines upper. PR: 203499 Reported by: cem git-svn-id: svn://svn.freebsd.org/base/stable/10@343605 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/geom/uzip/g_uzip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/geom/uzip/g_uzip.c b/sys/geom/uzip/g_uzip.c index 14868002b..d2926cd21 100644 --- a/sys/geom/uzip/g_uzip.c +++ b/sys/geom/uzip/g_uzip.c @@ -864,6 +864,7 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp) { struct g_provider *pp; + KASSERT(gp != NULL, ("NULL geom")); g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name); g_topology_assert(); @@ -873,7 +874,6 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp) 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) -- 2.45.0