Skip to content

Commit

Permalink
ACPI: sbs: check for NULL device pointer
Browse files Browse the repository at this point in the history
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Lebedev, Vladimir P authored and Len Brown committed Oct 14, 2006
1 parent b4bd8c6 commit 963497c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/acpi/sbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 963497c

Please sign in to comment.