提交 4988d0ae 编写于 作者: J Jiang Liu 提交者: Rafael J. Wysocki

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

Fix memory leak in function nouveau_optimus_dsm() and nouveau_dsm().
Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 d5c3d79e
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册