* [PATCH] nvmem: core: drop the leftover kfree(ops) from nvmem_unregister()
@ 2026-12-03 0:34 Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2026-12-03 0:34 UTC (permalink / raw)
To: Srinivas Kandagatla
Cc: Bartosz Golaszewski, James Hilliard, Greg Kroah-Hartman,
Mark Brown, Linux Next Mailing List, linux-kernel
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@kernel.org>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-03 0:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 0:34 [PATCH] nvmem: core: drop the leftover kfree(ops) from nvmem_unregister() Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox