From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Len Brown <len.brown@intel.com>
Cc: Zhang Rui <rui.zhang@intel.com>, linux-acpi@vger.kernel.org
Subject: [PATCH 1/4] ACPI: video - fix oops when unloading module
Date: Sat, 08 Aug 2009 00:26:20 -0700 [thread overview]
Message-ID: <20090808075631.77F4F526EC9@mailhub.coreip.homeip.net> (raw)
In-Reply-To: <20090808072150.2980.3863.stgit@localhost.localdomain>
Don't assume that backlight is always present.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/acpi/video.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 8851315..d8e64cf 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -2004,8 +2004,12 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
status = acpi_remove_notify_handler(device->dev->handle,
ACPI_DEVICE_NOTIFY,
acpi_video_device_notify);
- sysfs_remove_link(&device->backlight->dev.kobj, "device");
- backlight_device_unregister(device->backlight);
+
+ if (device->backlight) {
+ sysfs_remove_link(&device->backlight->dev.kobj, "device");
+ backlight_device_unregister(device->backlight);
+ }
+
if (device->cdev) {
sysfs_remove_link(&device->dev->dev.kobj,
"thermal_cooling");
@@ -2014,6 +2018,7 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
thermal_cooling_device_unregister(device->cdev);
device->cdev = NULL;
}
+
video_output_unregister(device->output_dev);
return 0;
next parent reply other threads:[~2009-08-08 7:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090808072150.2980.3863.stgit@localhost.localdomain>
2009-08-08 7:26 ` Dmitry Torokhov [this message]
2009-08-10 1:31 ` [PATCH 1/4] ACPI: video - fix oops when unloading module Zhang Rui
2009-08-30 2:55 ` Len Brown
2009-08-08 7:26 ` [PATCH 2/4] ACPI: video - fix potential crash when unloading Dmitry Torokhov
2009-08-10 2:11 ` Zhang Rui
2009-08-30 2:59 ` Len Brown
2009-08-08 7:26 ` [PATCH 3/4] ACPI: video - rename cdev to cooling_device Dmitry Torokhov
2009-08-30 3:04 ` Len Brown
2009-08-08 7:26 ` [PATCH 4/4] ACPI: video - cleanup video device registration Dmitry Torokhov
2009-08-10 2:11 ` Zhang Rui
2009-08-10 5:51 ` Dmitry Torokhov
2009-08-10 6:21 ` Zhang Rui
2009-08-30 3:24 ` Len Brown
2009-09-01 6:30 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090808075631.77F4F526EC9@mailhub.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.