Commit 59fc9e5e authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Len Brown

ACPI: remove null pointer checks in deferred execution path

Better to oops and learn about a bug than to silently cover it up.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 9ac61856
...@@ -699,18 +699,12 @@ void acpi_os_derive_pci_id(acpi_handle rhandle, /* upper bound */ ...@@ -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) static void acpi_os_execute_deferred(struct work_struct *work)
{ {
struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, 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) if (dpc->wait)
acpi_os_wait_events_complete(NULL); acpi_os_wait_events_complete(NULL);
dpc->function(dpc->context); dpc->function(dpc->context);
kfree(dpc); kfree(dpc);
return;
} }
/******************************************************************************* /*******************************************************************************
...@@ -739,9 +733,6 @@ static acpi_status __acpi_os_execute(acpi_execute_type type, ...@@ -739,9 +733,6 @@ static acpi_status __acpi_os_execute(acpi_execute_type type,
"Scheduling function [%p(%p)] for deferred execution.\n", "Scheduling function [%p(%p)] for deferred execution.\n",
function, context)); function, context));
if (!function)
return AE_BAD_PARAMETER;
/* /*
* Allocate/initialize DPC structure. Note that this memory will be * Allocate/initialize DPC structure. Note that this memory will be
* freed by the callee. The kernel handles the work_struct list in a * freed by the callee. The kernel handles the work_struct list in a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment