[CPUFREQ] fix double freeing in error path of pcc-cpufreq
Prevent double freeing on error path. Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com> Signed-off-by: Dave Jones <davej@redhat.com>
This commit is contained in:
Родитель
47f8bcf362
Коммит
3847d223f2
|
@ -368,22 +368,16 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
out_obj = output.pointer;
|
out_obj = output.pointer;
|
||||||
if (out_obj->type != ACPI_TYPE_BUFFER) {
|
if (out_obj->type != ACPI_TYPE_BUFFER)
|
||||||
ret = -ENODEV;
|
return -ENODEV;
|
||||||
goto out_free;
|
|
||||||
}
|
|
||||||
|
|
||||||
errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0);
|
errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0);
|
||||||
if (errors) {
|
if (errors)
|
||||||
ret = -ENODEV;
|
return -ENODEV;
|
||||||
goto out_free;
|
|
||||||
}
|
|
||||||
|
|
||||||
supported = *((u32 *)(out_obj->buffer.pointer + 4));
|
supported = *((u32 *)(out_obj->buffer.pointer + 4));
|
||||||
if (!(supported & 0x1)) {
|
if (!(supported & 0x1))
|
||||||
ret = -ENODEV;
|
return -ENODEV;
|
||||||
goto out_free;
|
|
||||||
}
|
|
||||||
|
|
||||||
out_free:
|
out_free:
|
||||||
kfree(output.pointer);
|
kfree(output.pointer);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче