Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4988d0ae authored by Jiang Liu's avatar Jiang Liu Committed by Rafael J. Wysocki
Browse files

nouveau / ACPI: fix memory leak in ACPI _DSM related code



Fix memory leak in function nouveau_optimus_dsm() and nouveau_dsm().

Signed-off-by: default avatarJiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent d5c3d79e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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) {