diff options
| author | Leo Cheng <leo-cheng@vip.qq.com> | 2026-08-11 20:55:48 +0800 |
|---|---|---|
| committer | Srinivas Kandagatla <srini@kernel.org> | 2026-09-18 22:35:34 +0100 |
| commit | 885c33944796ec7ddf6b7babfc0f0710f66bfce3 (patch) | |
| tree | 852b2061c5f85e75e0c4e548f31d4564e1b3297f /tools/perf/scripts/python/task-analyzer.py | |
| parent | 798be42019957b28b4fb897d7f9f6cf6712247db (diff) | |
| download | linux-next-885c33944796ec7ddf6b7babfc0f0710f66bfce3.tar.gz linux-next-885c33944796ec7ddf6b7babfc0f0710f66bfce3.zip | |
nvmem: layouts: sl28vpd: fix device_node reference leak in error path
sl28vpd_add_cells() takes a reference on the child node via
of_get_child_by_name() for each entry and passes it to
nvmem_add_one_cell() as info.np. On success the created cell entry
adopts that reference and releases it later via of_node_put() when the
entry is torn down; nvmem_add_one_cell() does not take its own
reference. On failure it does not consume the reference either, so the
caller still owns it, but the error path only puts layout_np before
returning, leaking the child node reference.
Put info.np on the error path as well. of_node_put(NULL) is a no-op, so
this is safe even when of_get_child_by_name() returned NULL.
Fixes: d9fae023fe86 ("nvmem: layouts: sl28vpd: Add new layout driver")
Signed-off-by: Leo Cheng <leo-cheng@vip.qq.com>
Reviewed-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions
