1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-31 16:57:10 +00:00

g_label: fix possible NULL pointer dereference

in case glabel debug level is >= 1 and gp->provider list is empty
for some reason

Found by:	clang static analyzer
MFC after:	4 days
This commit is contained in:
Andriy Gapon 2010-05-31 09:10:39 +00:00
parent 6b3ee24839
commit 56b3acd001
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208672

View File

@ -203,10 +203,8 @@ g_label_destroy(struct g_geom *gp, boolean_t force)
pp->acr, pp->acw, pp->ace);
return (EBUSY);
}
} else {
G_LABEL_DEBUG(1, "Label %s removed.",
LIST_FIRST(&gp->provider)->name);
}
} else if (pp != NULL)
G_LABEL_DEBUG(1, "Label %s removed.", pp->name);
g_slice_spoiled(LIST_FIRST(&gp->consumer));
return (0);
}