From: Sasha Levin <sashal@kernel.org>
To: Srinivas Kandagatla <srini@kernel.org>
Cc: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
James Hilliard <james.hilliard1@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mark Brown <broonie@kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH] nvmem: core: drop the leftover kfree(ops) from nvmem_unregister()
Date: Wed, 2 Dec 2026 19:34:28 -0500 [thread overview]
Message-ID: <20261203003428.2867091-1-sashal@kernel.org> (raw)
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
reply other threads:[~2026-12-03 0:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261203003428.2867091-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=james.hilliard1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=srini@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox