[ACPI] acpi_remove_notify_handler() on video driver unload
authorKarol Kozimor <sziwan@hell.org.pl>
Sat, 30 Jul 2005 08:18:00 +0000 (04:18 -0400)
committerLen Brown <len.brown@intel.com>
Fri, 5 Aug 2005 02:32:51 +0000 (22:32 -0400)
The video driver doesn't properly remove all the notify handlers
on module unload.  This has a side effect of subdevices failing
to register on module reload, but sudden death looms if the
handlers trigger after the module is unloaded.

Signed-off-by: Karol Kozimor <sziwan@hell.org.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/video.c

index 2cf264fd52e072e42fcff07b9cc6c948c9cbbede..7b10a7b070c968bb2e754c339e1a81b2336b4a6b 100644 (file)
@@ -1665,6 +1665,7 @@ static int
 acpi_video_bus_put_one_device(
        struct acpi_video_device        *device)
 {
+       acpi_status status;
        struct acpi_video_bus *video;
 
        ACPI_FUNCTION_TRACE("acpi_video_bus_put_one_device");
@@ -1679,6 +1680,12 @@ acpi_video_bus_put_one_device(
        up(&video->sem);
        acpi_video_device_remove_fs(device->dev);
 
+       status = acpi_remove_notify_handler(device->handle,
+               ACPI_DEVICE_NOTIFY, acpi_video_device_notify);
+       if (ACPI_FAILURE(status))
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                       "Error removing notify handler\n"));
+
        return_VALUE(0);
 }