diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 4126c7002fc8..7b281ae540ad 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -695,7 +695,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) if (config->cells) { rval = nvmem_add_cells(nvmem, config->cells, config->ncells); if (rval) - goto err_teardown_compat; + goto err_remove_cells; } rval = nvmem_add_cells_from_table(nvmem); @@ -712,7 +712,6 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) err_remove_cells: nvmem_device_remove_all_cells(nvmem); -err_teardown_compat: if (config->compat) nvmem_sysfs_remove_compat(nvmem, config); err_device_del: