Linux ACPI
 help / color / mirror / Atom feed
From: donald.d.dugger@intel.com
To: linux-acpi@vger.kernel.org
Cc: bjorn.helgaas@hp.com, akpm@linux-foundation.org,
	astarikovskiy@suse.de, lenb@kernel.org
Subject: [PATCH] Fix possible null ptr dereference
Date: Fri, 17 Oct 2008 07:49:50 -0700	[thread overview]
Message-ID: <200810171449.m9HEnoHM018514@los-vmm.sc.intel.com> (raw)

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)

             reply	other threads:[~2008-10-17 14:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-17 14:49 donald.d.dugger [this message]
2008-10-17 16:44 ` [PATCH] Fix possible null ptr dereference 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200810171449.m9HEnoHM018514@los-vmm.sc.intel.com \
    --to=donald.d.dugger@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=astarikovskiy@suse.de \
    --cc=bjorn.helgaas@hp.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox