summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sbs.c
diff options
context:
space:
mode:
authorLebedev, Vladimir P <vladimir.p.lebedev@intel.com>2006-09-05 17:49:13 +0200
committerLen Brown <len.brown@intel.com>2006-10-14 06:33:52 +0200
commit963497c12acb4d43caa9751b9291b014eea51a1a (patch)
tree0f03381df050a060f884d6f9a0a8b7fce9e9557d /drivers/acpi/sbs.c
parentLinux 2.6.19-rc2 (diff)
downloadlinux-963497c12acb4d43caa9751b9291b014eea51a1a.tar.xz
linux-963497c12acb4d43caa9751b9291b014eea51a1a.zip
ACPI: sbs: check for NULL device pointer
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/sbs.c')
-rw-r--r--drivers/acpi/sbs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 62bef0b3b614..79f38f036775 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -1685,10 +1685,16 @@ static int acpi_sbs_add(struct acpi_device *device)
int acpi_sbs_remove(struct acpi_device *device, int type)
{
- struct acpi_sbs *sbs = (struct acpi_sbs *)acpi_driver_data(device);
+ struct acpi_sbs *sbs = NULL;
int id;
- if (!device || !sbs) {
+ if (!device) {
+ return -EINVAL;
+ }
+
+ sbs = (struct acpi_sbs *)acpi_driver_data(device);
+
+ if (!sbs) {
return -EINVAL;
}