Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v6.6-LTS] nvmem: zynqmp_nvmem: unbreak driver after cleanup
@ 2025-11-05 12:36 Ivan Vera
  2025-11-06  7:23 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Ivan Vera @ 2025-11-05 12:36 UTC (permalink / raw)
  To: git; +Cc: Peter Korsgaard, stable, Michal Simek, Srinivas Kandagatla,
	Ivan Vera

From: Peter Korsgaard <peter@korsgaard.com>

Commit 29be47fcd6a0 ("nvmem: zynqmp_nvmem: zynqmp_nvmem_probe cleanup")
changed the driver to expect the device pointer to be passed as the
"context", but in nvmem the context parameter comes from nvmem_config.priv
which is never set - Leading to null pointer exceptions when the device is
accessed.

Fixes: 29be47fcd6a0 ("nvmem: zynqmp_nvmem: zynqmp_nvmem_probe cleanup")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
State: upstream (c708bbd57d158d9f20c2fcea5bcb6e0afac77bef)
(cherry picked from commit 94c91acb3721403501bafcdd041bcd422c5b23c4)
Signed-off-by: Ivan Vera <ivan.vera@enclustra.com>
---
 drivers/nvmem/zynqmp_nvmem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvmem/zynqmp_nvmem.c b/drivers/nvmem/zynqmp_nvmem.c
index 68c51cc3efa1..0f308e53d82f 100644
--- a/drivers/nvmem/zynqmp_nvmem.c
+++ b/drivers/nvmem/zynqmp_nvmem.c
@@ -213,6 +213,7 @@ static int zynqmp_nvmem_probe(struct platform_device *pdev)
 	econfig.word_size = 1;
 	econfig.size = ZYNQMP_NVMEM_SIZE;
 	econfig.dev = dev;
+	econfig.priv = dev;
 	econfig.add_legacy_fixed_of_cells = true;
 	econfig.reg_read = zynqmp_nvmem_read;
 	econfig.reg_write = zynqmp_nvmem_write;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-11-06  9:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-05 12:36 [PATCH v6.6-LTS] nvmem: zynqmp_nvmem: unbreak driver after cleanup Ivan Vera
2025-11-06  7:23 ` Greg KH
2025-11-06  7:38   ` Peter Korsgaard
2025-11-06  8:51     ` Greg KH
2025-11-06  9:08       ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox