summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_acpi.c
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2013-12-19 20:38:21 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-05 16:07:15 +0100
commit4988d0aeb6843b7070e406f8e6cb095c74e5f136 (patch)
tree78088fa535739a608c981b95cdb9ead6cfee350e /drivers/gpu/drm/nouveau/nouveau_acpi.c
parentd5c3d79e5ec6219fb20bf358d1e1bbaea1c36591 (diff)
downloadlinux-4988d0aeb6843b7070e406f8e6cb095c74e5f136.tar.gz
linux-4988d0aeb6843b7070e406f8e6cb095c74e5f136.tar.bz2
linux-4988d0aeb6843b7070e406f8e6cb095c74e5f136.zip
nouveau / ACPI: fix memory leak in ACPI _DSM related code
Fix memory leak in function nouveau_optimus_dsm() and nouveau_dsm(). Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_acpi.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_acpi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index ba0183fb84f3..3f721e317fef 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -111,6 +111,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;
}
@@ -157,8 +158,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) {