if_ovpn: fix memory leak on unload
When we're unloading the if_ovpn module we sometimes end up only freeing the softc after the module is unloaded and the M_OVPN malloc type no longer exists. Don't return from ovpn_clone_destroy() until the epoch callbacks have been called, which ensures that we've freed the softc before we destroy M_OVPN. Sponsored by: Rubicon Communications, LLC ("Netgate")
This commit is contained in:
parent
9dfbbc919f
commit
d99d59a79f
@ -2421,6 +2421,8 @@ ovpn_clone_destroy(struct if_clone *ifc, struct ifnet *ifp)
|
|||||||
if (unit != IF_DUNIT_NONE)
|
if (unit != IF_DUNIT_NONE)
|
||||||
ifc_free_unit(ifc, unit);
|
ifc_free_unit(ifc, unit);
|
||||||
|
|
||||||
|
NET_EPOCH_DRAIN_CALLBACKS();
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user