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
This commit is contained in:
Justin Hibbits 2018-02-14 15:12:09 +00:00
parent f5ce166436
commit d793587fe2

View File

@ -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);