diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index c0f4324d8f7c8..cde1d77845fee 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -439,7 +439,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); @@ -456,7 +456,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: