From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Lv Zheng <lv.zheng@intel.com>, Len Brown <lenb@kernel.org>,
Tony Luck <tony.luck@intel.com>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [Patch v2 03/13] PCI, pci-label: release allocated ACPI object on error recovery path
Date: Fri, 20 Dec 2013 03:01:55 +0100 [thread overview]
Message-ID: <1896409.Ntvojm0Xli@vostro.rjw.lan> (raw)
In-Reply-To: <CAErSpo4oKsJCKxUhxT8E745BkX+veOD-tMEeHULHOuH-3suMRA@mail.gmail.com>
On Thursday, December 19, 2013 11:22:22 AM Bjorn Helgaas wrote:
> On Thu, Dec 19, 2013 at 5:38 AM, Jiang Liu <jiang.liu@linux.intel.com> wrote:
> > Function dsm_get_label() leaks the returned ACPI object if
> > obj->package.count is not 2, so fix the possible memory leak.
> >
> > Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
>
> Rafael, if you want to take these through your tree, feel free.
I'm going to do that, thanks!
> I'm guessing it probably makes sense to keep the whole series together.
Agreed.
> > ---
> > drivers/pci/pci-label.c | 12 ++++--------
> > 1 file changed, 4 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
> > index d51f45a..f6e01a5 100644
> > --- a/drivers/pci/pci-label.c
> > +++ b/drivers/pci/pci-label.c
> > @@ -233,11 +233,7 @@ dsm_get_label(acpi_handle handle, int func,
> > return -1;
> >
> > obj = (union acpi_object *)output->pointer;
> > -
> > - switch (obj->type) {
> > - case ACPI_TYPE_PACKAGE:
> > - if (obj->package.count != 2)
> > - break;
> > + if (obj->type == ACPI_TYPE_PACKAGE && obj->package.count == 2) {
> > len = obj->package.elements[0].integer.value;
> > if (buf) {
> > if (attribute == ACPI_ATTR_INDEX_SHOW)
> > @@ -250,10 +246,10 @@ dsm_get_label(acpi_handle handle, int func,
> > }
> > kfree(output->pointer);
> > return len;
> > - break;
> > - default:
> > - kfree(output->pointer);
> > }
> > +
> > + kfree(output->pointer);
> > +
> > return -1;
> > }
> >
> > --
> > 1.7.10.4
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2013-12-20 1:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-19 12:38 [Patch v2 00/13] Introduce ACPI _DSM helper functions to simplify code Jiang Liu
2013-12-19 12:38 ` [Patch v2 01/13] ACPI: introduce helper interfaces to support ACPI _DSM method Jiang Liu
2013-12-19 12:38 ` [Patch v2 03/13] PCI, pci-label: release allocated ACPI object on error recovery path Jiang Liu
2013-12-19 18:22 ` Bjorn Helgaas
2013-12-20 2:01 ` Rafael J. Wysocki [this message]
2013-12-19 12:38 ` [Patch v2 04/13] ACPI, PCI: replace open-coded _DSM specific code with helper functions Jiang Liu
2013-12-19 12:38 ` [Patch v2 05/13] PCI, pci-label: treat PCI label with index 0 as valid label Jiang Liu
2013-12-19 12:38 ` [Patch v2 06/13] ACPI, TPM: fix memory leak when walking ACPI namespace Jiang Liu
2013-12-19 12:38 ` [Patch v2 07/13] ACPI, TPM: matching node name instead of full path when searching for TPM device Jiang Liu
2013-12-19 12:38 ` [Patch v2 08/13] ACPI, TPM: replace open-coded _DSM specific code with helper functions Jiang Liu
2013-12-19 12:38 ` [Patch v2 09/13] ACPI, TPM: detecting PPI features by checking availability of _DSM functions Jiang Liu
2013-12-19 12:38 ` [Patch v2 10/13] ACPI, i2c-hid: replace open-coded _DSM specific code with helper functions Jiang Liu
2013-12-19 12:38 ` [Patch v2 11/13] ACPI, i915: " Jiang Liu
2013-12-19 12:38 ` [Patch v2 12/13] nouveau: fix memory leak in ACPI _DSM related code Jiang Liu
2013-12-19 12:38 ` [Patch v2 13/13] ACPI, nouveau: replace open-coded _DSM specific code with helper functions Jiang Liu
2014-01-05 21:58 ` [Patch v2 00/13] Introduce ACPI _DSM helper functions to simplify code Rafael J. Wysocki
2014-01-06 6:18 ` Jiang Liu
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=1896409.Ntvojm0Xli@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=bhelgaas@google.com \
--cc=jiang.liu@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=tony.luck@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®