diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 13891745a9719..867c8aa92b3ac 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -945,6 +945,7 @@ __thermal_cooling_device_register(struct device_node *np, return cdev; out_kfree_type: + thermal_cooling_device_destroy_sysfs(cdev); kfree(cdev->type); put_device(&cdev->device); cdev = NULL;