All of lore.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <len.brown@intel.com>
To: linux-acpi@vger.kernel.org
Cc: Myron Stowe <myron.stowe@hp.com>, Len Brown <len.brown@intel.com>
Subject: [PATCH 2/3] ACPICA: fix error path in new external package objects as method arguments
Date: Sat, 23 Jun 2007 11:04:47 -0400	[thread overview]
Message-ID: <11826110902815-git-send-email-len.brown@intel.com> (raw)
Message-ID: <83dd4504456d4b5e464d6ec4a7665e2c922db67f.1182611002.git.len.brown@intel.com> (raw)
In-Reply-To: <11826110891391-git-send-email-len.brown@intel.com>
In-Reply-To: <e7c746ef098770f863ba294adac5b30d124ba469.1182611002.git.len.brown@intel.com>

From: Myron Stowe <myron.stowe@hp.com>

In the routine acpi_ut_create_package_object(), if the
ACPI_ALLOCATE_ZEROED() fails then ACPI_FREE(package_desc) is called as
part of the cleanup.  This should instead be
acpi_ut_remove_reference(package_desc) in order to remove the reference
acquired from acpi_ut_create_internal_object() [see the routine
acpi_ut_create_buffer_object() as an example of proper functionality].

Signed-off-by: Myron Stowe <myron.stowe@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/utilities/utobject.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index db0b9ba..76ee766 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -177,7 +177,7 @@ union acpi_operand_object *acpi_ut_create_package_object(u32 count)
 	package_elements = ACPI_ALLOCATE_ZEROED((acpi_size)
 						(count + 1) * sizeof(void *));
 	if (!package_elements) {
-		ACPI_FREE(package_desc);
+		acpi_ut_remove_reference(package_desc);
 		return_PTR(NULL);
 	}
 
-- 
1.5.2.1.255.gca6c0

  parent reply	other threads:[~2007-06-23 15:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-23 15:04 ACPI patches for 2.6.22-rc5 Len Brown
2007-06-23 15:04 ` [PATCH 1/3] ACPI: gracefully print null trip-point device Len Brown
2007-06-23 15:04   ` Len Brown
2007-06-23 15:04   ` Len Brown [this message]
2007-06-23 15:04     ` [PATCH 2/3] ACPICA: fix error path in new external package objects as method arguments Len Brown
2007-06-23 15:04   ` [PATCH 3/3] ACPI: fix 2.6.20 SMP boot regression Len Brown
2007-06-23 15:04     ` Len Brown

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=11826110902815-git-send-email-len.brown@intel.com \
    --to=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=myron.stowe@hp.com \
    /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 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.