[FreeBSD] We need to call drm_detach before we free dev->driver.
The driver is in control of the show, so when you try and unload a module the driver detach routine is called first. It is what drives the whole unload process and so lots of panics occur if dev->driver is already free.main
parent
2880c86eb2
commit
828ae3f6b8
|
@ -122,10 +122,13 @@ static int
|
|||
i915_detach(device_t nbdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
|
||||
free(dev->driver, M_DRM);
|
||||
|
||||
return drm_detach(nbdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static device_method_t i915_methods[] = {
|
||||
|
|
|
@ -96,10 +96,13 @@ static int
|
|||
mach64_detach(device_t nbdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
|
||||
free(dev->driver, M_DRM);
|
||||
|
||||
return drm_detach(nbdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static device_method_t mach64_methods[] = {
|
||||
|
|
|
@ -142,10 +142,13 @@ static int
|
|||
mga_detach(device_t nbdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
|
||||
free(dev->driver, M_DRM);
|
||||
|
||||
return drm_detach(nbdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static device_method_t mga_methods[] = {
|
||||
|
|
|
@ -95,10 +95,13 @@ static int
|
|||
r128_detach(device_t nbdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
|
||||
free(dev->driver, M_DRM);
|
||||
|
||||
return drm_detach(nbdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static device_method_t r128_methods[] = {
|
||||
|
|
|
@ -100,10 +100,13 @@ static int
|
|||
radeon_detach(device_t nbdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
|
||||
free(dev->driver, M_DRM);
|
||||
|
||||
return drm_detach(nbdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static device_method_t radeon_methods[] = {
|
||||
|
|
|
@ -86,10 +86,13 @@ static int
|
|||
savage_detach(device_t nbdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
|
||||
free(dev->driver, M_DRM);
|
||||
|
||||
return drm_detach(nbdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static device_method_t savage_methods[] = {
|
||||
|
|
|
@ -80,10 +80,13 @@ static int
|
|||
sis_detach(device_t nbdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
|
||||
free(dev->driver, M_DRM);
|
||||
|
||||
return drm_detach(nbdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static device_method_t sis_methods[] = {
|
||||
|
|
|
@ -82,10 +82,13 @@ static int
|
|||
tdfx_detach(device_t nbdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
|
||||
free(dev->driver, M_DRM);
|
||||
|
||||
return drm_detach(nbdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static device_method_t tdfx_methods[] = {
|
||||
|
|
|
@ -93,10 +93,13 @@ static int
|
|||
via_detach(device_t nbdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
|
||||
free(dev->driver, M_DRM);
|
||||
|
||||
return drm_detach(nbdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static device_method_t via_methods[] = {
|
||||
|
|
Loading…
Reference in New Issue