Skip to content

Commit

Permalink
nouveau / ACPI: fix memory leak in ACPI _DSM related code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiang Liu authored and Rafael J. Wysocki committed Jan 5, 2014
1 parent d5c3d79 commit 4988d0a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/nouveau/nouveau_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4988d0a

Please sign in to comment.