summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2013-12-19 12:38:21 (GMT)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-05 15:07:15 (GMT)
commit4988d0aeb6843b7070e406f8e6cb095c74e5f136 (patch)
tree78088fa535739a608c981b95cdb9ead6cfee350e /drivers/gpu
parentd5c3d79e5ec6219fb20bf358d1e1bbaea1c36591 (diff)
downloadlinux-4988d0aeb6843b7070e406f8e6cb095c74e5f136.tar.xz
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')
-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 ba0183f..3f721e3 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) {