Commit 0be86969 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Zhang Rui

thermal: int3400_thermal: fix error handling in int3400_thermal_probe()

There are resources that are not dealocated on failure path
in int3400_thermal_probe().

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 261ac1d2
......@@ -319,17 +319,21 @@ static int int3400_thermal_probe(struct platform_device *pdev)
result = sysfs_create_group(&pdev->dev.kobj, &uuid_attribute_group);
if (result)
goto free_zone;
goto free_rel_misc;
result = acpi_install_notify_handler(
priv->adev->handle, ACPI_DEVICE_NOTIFY, int3400_notify,
(void *)priv);
if (result)
goto free_zone;
goto free_sysfs;
return 0;
free_zone:
free_sysfs:
sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
free_rel_misc:
if (!priv->rel_misc_dev_res)
acpi_thermal_rel_misc_device_remove(priv->adev->handle);
thermal_zone_device_unregister(priv->thermal);
free_art_trt:
kfree(priv->trts);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment