diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c index 91606bb55318110307e3997bcb61722cd247ee73..f06bad047d76ebcf674cfe4eed5b9627335dddf0 100644 --- a/drivers/power/power_supply_core.c +++ b/drivers/power/power_supply_core.c @@ -190,10 +190,10 @@ int power_supply_register(struct device *parent, struct power_supply *psy) goto success; create_triggers_failed: - device_unregister(psy->dev); + device_del(dev); kobject_set_name_failed: device_add_failed: - kfree(dev); + put_device(dev); success: return rc; }