Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jun 2012 16:05:10 +0000 (UTC)
From:      "Kenneth D. Merry" <ken@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r237648 - head/sys/geom
Message-ID:  <201206271605.q5RG5AqG019340@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ken
Date: Wed Jun 27 16:05:09 2012
New Revision: 237648
URL: http://svn.freebsd.org/changeset/base/237648

Log:
  In g_disk_providergone(), don't continue if the softc is NULL.  This may be
  the case if we've already gone through g_disk_destroy().
  
  Reported by:	Michael Butler <imb@protected-networks.net>
  MFC after:	3 days

Modified:
  head/sys/geom/geom_disk.c

Modified: head/sys/geom/geom_disk.c
==============================================================================
--- head/sys/geom/geom_disk.c	Wed Jun 27 15:55:34 2012	(r237647)
+++ head/sys/geom/geom_disk.c	Wed Jun 27 16:05:09 2012	(r237648)
@@ -502,6 +502,14 @@ g_disk_providergone(struct g_provider *p
 	struct g_disk_softc *sc;
 
 	sc = (struct g_disk_softc *)pp->geom->softc;
+
+	/*
+	 * If the softc is already NULL, then we've probably been through
+	 * g_disk_destroy already; there is nothing for us to do anyway.
+	 */
+	if (sc == NULL)
+		return;
+
 	dp = sc->dp;
 
 	if (dp->d_gone != NULL)



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