In g_gate_dumpconf() always check the result of g_gate_hold().
This fixes "Negative sc_ref" panic possible when sysctl_kern_geom_confxml() is run simultaneously with destroying GATE device. Reviewed by: pjd MFC after: 3 days
This commit is contained in:
parent
6337d82014
commit
1d9db37c77
@ -398,7 +398,9 @@ g_gate_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp,
|
||||
sc = gp->softc;
|
||||
if (sc == NULL || pp != NULL || cp != NULL)
|
||||
return;
|
||||
g_gate_hold(sc->sc_unit, NULL);
|
||||
sc = g_gate_hold(sc->sc_unit, NULL);
|
||||
if (sc == NULL)
|
||||
return;
|
||||
if ((sc->sc_flags & G_GATE_FLAG_READONLY) != 0) {
|
||||
sbuf_printf(sb, "%s<access>%s</access>\n", indent, "read-only");
|
||||
} else if ((sc->sc_flags & G_GATE_FLAG_WRITEONLY) != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user