aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2013-12-19 07:38:21 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-05 10:07:15 -0500
commit4988d0aeb6843b7070e406f8e6cb095c74e5f136 (patch)
tree78088fa535739a608c981b95cdb9ead6cfee350e /drivers/gpu
parentd5c3d79e5ec6219fb20bf358d1e1bbaea1c36591 (diff)
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 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 *
111 111
112 if (obj->type == ACPI_TYPE_INTEGER) 112 if (obj->type == ACPI_TYPE_INTEGER)
113 if (obj->integer.value == 0x80000002) { 113 if (obj->integer.value == 0x80000002) {
114 kfree(output.pointer);
114 return -ENODEV; 115 return -ENODEV;
115 } 116 }
116 117
@@ -157,8 +158,10 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
157 obj = (union acpi_object *)output.pointer; 158 obj = (union acpi_object *)output.pointer;
158 159
159 if (obj->type == ACPI_TYPE_INTEGER) 160 if (obj->type == ACPI_TYPE_INTEGER)
160 if (obj->integer.value == 0x80000002) 161 if (obj->integer.value == 0x80000002) {
162 kfree(output.pointer);
161 return -ENODEV; 163 return -ENODEV;
164 }
162 165
163 if (obj->type == ACPI_TYPE_BUFFER) { 166 if (obj->type == ACPI_TYPE_BUFFER) {
164 if (obj->buffer.length == 4 && result) { 167 if (obj->buffer.length == 4 && result) {