summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sbs.c
diff options
context:
space:
mode:
authorLebedev, Vladimir P <vladimir.p.lebedev@intel.com>2006-09-05 19:49:13 +0400
committerLen Brown <len.brown@intel.com>2006-10-14 00:33:52 -0400
commit963497c12acb4d43caa9751b9291b014eea51a1a (patch)
tree0f03381df050a060f884d6f9a0a8b7fce9e9557d /drivers/acpi/sbs.c
parentb4bd8c66435a8cdf8c90334fb3b517a23ff2ab95 (diff)
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 62bef0b3b61..79f38f03677 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;
}