From: Jiang Liu <jiang.liu@linux.intel.com>
To: "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Lv Zheng <lv.zheng@intel.com>, Len Brown <lenb@kernel.org>,
David Airlie <airlied@linux.ie>
Cc: Jiang Liu <jiang.liu@linux.intel.com>,
Tony Luck <tony.luck@intel.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: [Patch v2 12/13] nouveau: fix memory leak in ACPI _DSM related code
Date: Thu, 19 Dec 2013 20:38:21 +0800 [thread overview]
Message-ID: <1387456702-4709-13-git-send-email-jiang.liu@linux.intel.com> (raw)
In-Reply-To: <1387456702-4709-1-git-send-email-jiang.liu@linux.intel.com>
Fix memory leak in function nouveau_optimus_dsm() and nouveau_dsm().
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
drivers/gpu/drm/nouveau/nouveau_acpi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index 95c7404..03d4911 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -110,6 +110,7 @@ static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *
if (obj->type == ACPI_TYPE_INTEGER)
if (obj->integer.value == 0x80000002) {
+ kfree(output.pointer);
return -ENODEV;
}
@@ -156,8 +157,10 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
obj = (union acpi_object *)output.pointer;
if (obj->type == ACPI_TYPE_INTEGER)
- if (obj->integer.value == 0x80000002)
+ if (obj->integer.value == 0x80000002) {
+ kfree(output.pointer);
return -ENODEV;
+ }
if (obj->type == ACPI_TYPE_BUFFER) {
if (obj->buffer.length == 4 && result) {
--
1.7.10.4
next prev parent reply other threads:[~2013-12-19 12:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1387456702-4709-1-git-send-email-jiang.liu@linux.intel.com>
2013-12-19 12:38 ` [Patch v2 11/13] ACPI, i915: replace open-coded _DSM specific code with helper functions Jiang Liu
2013-12-19 12:38 ` Jiang Liu [this message]
2013-12-19 12:38 ` [Patch v2 13/13] ACPI, nouveau: " 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=1387456702-4709-13-git-send-email-jiang.liu@linux.intel.com \
--to=jiang.liu@linux.intel.com \
--cc=airlied@linux.ie \
--cc=bhelgaas@google.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).