Skip to content

Commit

Permalink
ACPI: remove null pointer checks in deferred execution path
Browse files Browse the repository at this point in the history
Better to oops and learn about a bug than to silently cover it up.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Sep 19, 2009
1 parent 9ac6185 commit 59fc9e5
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,18 +699,12 @@ void acpi_os_derive_pci_id(acpi_handle rhandle, /* upper bound */
static void acpi_os_execute_deferred(struct work_struct *work)
{
struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work);
if (!dpc) {
printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
return;
}

if (dpc->wait)
acpi_os_wait_events_complete(NULL);

dpc->function(dpc->context);
kfree(dpc);

return;
}

/*******************************************************************************
Expand Down Expand Up @@ -739,9 +733,6 @@ static acpi_status __acpi_os_execute(acpi_execute_type type,
"Scheduling function [%p(%p)] for deferred execution.\n",
function, context));

if (!function)
return AE_BAD_PARAMETER;

/*
* Allocate/initialize DPC structure. Note that this memory will be
* freed by the callee. The kernel handles the work_struct list in a
Expand Down

0 comments on commit 59fc9e5

Please sign in to comment.