From 828ae3f6b88b5a69a56b2961307e40ed95edea29 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Mon, 8 Sep 2008 16:40:52 -0400 Subject: [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. --- bsd-core/tdfx_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bsd-core/tdfx_drv.c') diff --git a/bsd-core/tdfx_drv.c b/bsd-core/tdfx_drv.c index 8fafe0fe..8d9e272f 100644 --- a/bsd-core/tdfx_drv.c +++ b/bsd-core/tdfx_drv.c @@ -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[] = { -- cgit v1.2.3