All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix possible null ptr dereference
@ 2008-10-17 14:49 donald.d.dugger
  2008-10-17 16:44 ` Len Brown
  2008-10-17 18:02 ` Moore, Robert
  0 siblings, 2 replies; 8+ messages in thread
From: donald.d.dugger @ 2008-10-17 14:49 UTC (permalink / raw)
  To: linux-acpi; +Cc: bjorn.helgaas, akpm, astarikovskiy, lenb

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>


----- cut here for patch.d/acpi_null-1017.patch -----
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index cf47805..65bf4fa 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -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);
@@ -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)

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-10-18 21:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-17 14:49 [PATCH] Fix possible null ptr dereference donald.d.dugger
2008-10-17 16:44 ` Len Brown
2008-10-17 18:02 ` Moore, Robert
2008-10-17 20:55   ` Len Brown
2008-10-17 21:49     ` Moore, Robert
2008-10-18 16:33       ` ACPICA header files Moore, Robert
2008-10-18 17:42         ` Alexey Starikovskiy
2008-10-18 21:05           ` Moore, Robert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.