Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 2018 15:12:09 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329262 - head/sys/geom/part
Message-ID:  <201802141512.w1EFC9f1049589@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Wed Feb 14 15:12:09 2018
New Revision: 329262
URL: https://svnweb.freebsd.org/changeset/base/329262

Log:
  Fix a panic introduced in r329225
  
  Some GEOM partition tables may be destroyed with incomplete partition
  entries.  Guard against this with NULL checks.
  
  Reported by:	pholm,others
  Reviewed by:	markj
  Tested by:	pholm

Modified:
  head/sys/geom/part/g_part.c

Modified: head/sys/geom/part/g_part.c
==============================================================================
--- head/sys/geom/part/g_part.c	Wed Feb 14 14:29:11 2018	(r329261)
+++ head/sys/geom/part/g_part.c	Wed Feb 14 15:12:09 2018	(r329262)
@@ -1549,9 +1549,11 @@ g_part_wither(struct g_geom *gp, int error)
 		while ((entry = LIST_FIRST(&table->gpt_entry)) != NULL) {
 			LIST_REMOVE(entry, gpe_entry);
 			pp = entry->gpe_pp;
-			entry->gpe_pp->private = NULL;
 			entry->gpe_pp = NULL;
-			g_wither_provider(pp, error);
+			if (pp != NULL) {
+				pp->private = NULL;
+				g_wither_provider(pp, error);
+			}
 			g_free(entry);
 		}
 		G_PART_DESTROY(table, NULL);



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