Skip to content

Commit

Permalink
ACPI: Fix possible null ptr dereference
Browse files Browse the repository at this point in the history
Code in `pci_link.c' is calling the internal routine `acpi_ut_evaluate_object'
which is dangerous given that it is passing a NULL pointer when it should
be passing a pointer to a real object.  The patch corrects the issue by
having the code call the external routine `acpi_evaluate_object', which
correctly handles a NULL pointer.

Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
donald.d.dugger@intel.com authored and Len Brown committed Oct 22, 2008
1 parent ea5c8af commit 383d7a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/acpi/pci_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ int acpi_pci_link_free_irq(acpi_handle handle)
acpi_device_bid(link->device)));

if (link->refcnt == 0) {
acpi_ut_evaluate_object(link->device->handle, "_DIS", 0, NULL);
acpi_evaluate_object(link->device->handle, "_DIS", NULL, NULL);
}
mutex_unlock(&acpi_link_lock);
return (link->irq.active);
Expand Down Expand Up @@ -773,7 +773,7 @@ static int acpi_pci_link_add(struct acpi_device *device)

end:
/* disable all links -- to be activated on use */
acpi_ut_evaluate_object(device->handle, "_DIS", 0, NULL);
acpi_evaluate_object(device->handle, "_DIS", NULL, NULL);
mutex_unlock(&acpi_link_lock);

if (result)
Expand Down

0 comments on commit 383d7a1

Please sign in to comment.