]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/thermal/int340x_thermal/int3400_thermal.c
thermal: int3400_thermal: fix error handling in int3400_thermal_probe()
[mirror_ubuntu-bionic-kernel.git] / drivers / thermal / int340x_thermal / int3400_thermal.c
index 8ee38f55c7f36c5e244711bb45bc3171b4d32ba1..43b90fd577e49d86852760b0b917e0660a473c88 100644 (file)
@@ -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);