Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2019 11:36:28 +0000 (UTC)
From:      Andriy Voskoboinyk <avos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r343605 - in stable: 10/sys/geom/uzip 11/sys/geom/uzip 12/sys/geom/uzip
Message-ID:  <201901311136.x0VBaSU5032667@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avos
Date: Thu Jan 31 11:36:28 2019
New Revision: 343605
URL: https://svnweb.freebsd.org/changeset/base/343605

Log:
  MFC r343473:
  geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced
  
  PR:		203499
  Submitted by:	<chadf@triularity.org>
  
  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

Modified:
  stable/10/sys/geom/uzip/g_uzip.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/geom/uzip/g_uzip.c
  stable/12/sys/geom/uzip/g_uzip.c
Directory Properties:
  stable/11/   (props changed)
  stable/12/   (props changed)

Modified: stable/10/sys/geom/uzip/g_uzip.c
==============================================================================
--- stable/10/sys/geom/uzip/g_uzip.c	Thu Jan 31 11:12:31 2019	(r343604)
+++ stable/10/sys/geom/uzip/g_uzip.c	Thu Jan 31 11:36:28 2019	(r343605)
@@ -864,6 +864,7 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_cla
 {
 	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_cla
 		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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901311136.x0VBaSU5032667>