diff options
| author | Weigang He <geoffreyhe2@gmail.com> | 2026-01-23 05:26:08 +0000 |
|---|---|---|
| committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2026-01-29 20:10:34 +0100 |
| commit | 7cce81df7d26d44123bd7620715c8349d96793d7 (patch) | |
| tree | 39e1f0cd6bb99d8678be626fc695a89e3d2c5927 /include/linux | |
| parent | 68cd8ef484521a01826735518f173c4ae3900eff (diff) | |
mtd: parsers: ofpart: fix OF node refcount leak in parse_fixed_partitions()
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.
This bug was detected by our static analysis tool.
Fixes: 562b4e91d3b2 ("mtd: parsers: ofpart: fix parsing subpartitions")
Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
