[PATCH v10 3/8] nvmem: core: take a reference on dev.of_node in nvmem_register()

sashiko-bot at kernel.org sashiko-bot at kernel.org
Thu Nov 12 03:57:22 PST 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] nvmem: core: missing Fixes trailer for nvmem_register() of_node
  reference fix
--

commit 34145a3067cdfbb6bf1220c524a41a448d6b7c85
Author: Manikandan Muralidharan <manikandan.m at microchip.com>

> nvmem: core: take a reference on dev.of_node in nvmem_register()
>
> nvmem_register() stores config->of_node (or config->dev->of_node)
> into nvmem->dev.of_node without taking its own reference. Callers
> that get the node via of_get_compatible_child() etc. and drop their
> reference right after registering leave nvmem->dev.of_node backed by
> no reference at all.
>
> Take an of_node_get() when assigning nvmem->dev.of_node and release
> it in nvmem_release(). Existing callers that hold their own get/put
> pair around the registration call need no changes, since get/put on
> a device_node is per-holder and independent of core now also holding
> one.
>
> Reviewed-by: Miquel Raynal <miquel.raynal at bootlin.com>
> Reviewed-by: Michael Walle <mwalle at kernel.org>
> Suggested-by: Michael Walle <mwalle at kernel.org>
> Signed-off-by: Manikandan Muralidharan <manikandan.m at microchip.com>

[Severity: Low]
This fixes a missing device_node reference in nvmem_register().  Should
the commit message include a Fixes tag for the commit that introduced
config->of_node handling:

  Fixes: 1333a6779501 ("nvmem: core: allow specifying of_node")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794391660.git.manikandan.m@microchip.com?part=3



More information about the linux-mtd mailing list