[PATCH] mtd: parsers: ofpart: fix OF node refcount leak in parse_fixed_partitions()
Miquel Raynal
miquel.raynal at bootlin.com
Thu Jan 29 11:12:23 PST 2026
On Fri, 23 Jan 2026 05:26:08 +0000, Weigang He wrote:
> of_get_child_by_name() returns a node pointer with refcount incremented,
> which must be released with of_node_put() when done. However, in
> parse_fixed_partitions(), when dedicated is true (i.e., a "partitions"
> subnode was found), the ofpart_node obtained from of_get_child_by_name()
> is never released on any code path.
>
> Add of_node_put(ofpart_node) calls on all exit paths when dedicated is
> true to fix the reference count leak.
>
> [...]
Applied to mtd/next, thanks!
[1/1] mtd: parsers: ofpart: fix OF node refcount leak in parse_fixed_partitions()
commit: 7cce81df7d26d44123bd7620715c8349d96793d7
Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl
More information about the linux-mtd
mailing list