Merge branches 'acpi-processor', 'acpi-cppc', 'acpi-dbg', 'acpi-misc' and 'acpi-pci'
[linux-2.6-microblaze.git] / drivers / acpi / sysfs.c
index c60d2c6..3a89909 100644 (file)
@@ -993,8 +993,10 @@ void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug,
 
        error = kobject_init_and_add(&hotplug->kobj,
                &acpi_hotplug_profile_ktype, hotplug_kobj, "%s", name);
-       if (error)
+       if (error) {
+               kobject_put(&hotplug->kobj);
                goto err_out;
+       }
 
        kobject_uevent(&hotplug->kobj, KOBJ_ADD);
        return;