uguru(4): Fix a panic when detaching (e.g., on kldunload).
authorSascha Wildner <saw@online.de>
Mon, 27 Feb 2012 19:52:26 +0000 (20:52 +0100)
committerSascha Wildner <saw@online.de>
Mon, 27 Feb 2012 19:53:12 +0000 (20:53 +0100)
Reported-by: Max Herrgard <herrgard@gmail.com>
sys/dev/powermng/uguru/uguru.c

index 7cf7be0..ec7d448 100644 (file)
@@ -891,6 +891,9 @@ uguru_detach(struct device *dev)
 {
        struct uguru_softc *sc = device_get_softc(dev);
 
+       sensordev_deinstall(&sc->sc_sensordev);
+       sensor_task_unregister(sc);
+
        return bus_release_resource(dev, SYS_RES_IOPORT,
            sc->sc_iorid, sc->sc_iores);
 }