mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Fix two use-after-free cases.
This commit is contained in:
parent
05f17943bb
commit
f2c9356328
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=169087
@ -84,13 +84,13 @@ vdev_geom_orphan(struct g_consumer *cp)
|
||||
|
||||
ZFS_LOG(1, "Closing access to %s.", cp->provider->name);
|
||||
g_access(cp, -cp->acr, -cp->acw, -cp->ace);
|
||||
g_detach(cp);
|
||||
ZFS_LOG(1, "Destroyed consumer to %s.", cp->provider->name);
|
||||
g_detach(cp);
|
||||
g_destroy_consumer(cp);
|
||||
/* Destroy geom if there are no consumers left. */
|
||||
if (LIST_EMPTY(&gp->consumer)) {
|
||||
ZFS_LOG(1, "Destroyed geom %s.", gp->name);
|
||||
g_wither_geom(cp->geom, error);
|
||||
g_wither_geom(gp, error);
|
||||
}
|
||||
vdev_geom_release(vd);
|
||||
/* Both methods below work, but in a bit different way. */
|
||||
|
@ -84,13 +84,13 @@ vdev_geom_orphan(struct g_consumer *cp)
|
||||
|
||||
ZFS_LOG(1, "Closing access to %s.", cp->provider->name);
|
||||
g_access(cp, -cp->acr, -cp->acw, -cp->ace);
|
||||
g_detach(cp);
|
||||
ZFS_LOG(1, "Destroyed consumer to %s.", cp->provider->name);
|
||||
g_detach(cp);
|
||||
g_destroy_consumer(cp);
|
||||
/* Destroy geom if there are no consumers left. */
|
||||
if (LIST_EMPTY(&gp->consumer)) {
|
||||
ZFS_LOG(1, "Destroyed geom %s.", gp->name);
|
||||
g_wither_geom(cp->geom, error);
|
||||
g_wither_geom(gp, error);
|
||||
}
|
||||
vdev_geom_release(vd);
|
||||
/* Both methods below work, but in a bit different way. */
|
||||
|
Loading…
Reference in New Issue
Block a user