[PATCH] nvmem: core: drop the leftover kfree(ops) from nvmem_unregister()
From: Sasha Levin
Date: Wed Dec 02 2026 - 19:34:35 EST
drivers/nvmem/core.c does not compile in the nvmem for-next branch:
drivers/nvmem/core.c:1147:8: error: use of undeclared identifier 'ops'
Commit 4508485e8156 ("nvmem: exclude disconnected providers from
callback admission") moved the teardown of nvmem->ops from
nvmem_unregister() to nvmem_disconnect(), which frees the operations
itself, and removed the local variable. Commit 96139b973a2a ("nvmem:
don't use devres in subsystem code") added a call to
nvmem_sysfs_remove_cells() right above the old kfree(ops). The merge of
the two kept both lines from the second side, kfree(ops) included.
Remove it. nvmem_disconnect() has freed the operations by then.
Fixes: 3a4c3aaebfe4 ("Merge branch 'nvmem-for-v7.5' into nvmem-for-next")
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
Based on nvmem for-next (3a4c3aaebfe4). Redoing the merge without the
kfree(ops) line gives the same tree. linux-next is fine: the merge of
the nvmem tree in next-20261202 drops the line.
The fixes side is in char-misc-linus now, so the same conflict will
come back when the v7.5 series is applied and the two meet.
Built drivers/nvmem/core.o on x86_64 defconfig with clang 21, W=1.
drivers/nvmem/core.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index b5af34e523b67..1b09f5ee27cae 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -1144,7 +1144,6 @@ void nvmem_unregister(struct nvmem_device *nvmem)
nvmem_sysfs_remove_compat(nvmem);
nvmem_destroy_layout(nvmem);
nvmem_sysfs_remove_cells(nvmem);
- kfree(ops);
device_unregister(&nvmem->dev);
}
base-commit: 3a4c3aaebfe40cc8d6517b749920068fa7a9d9a0
--
2.53.0