Commit d3bacdd
i3c: fix refcount inconsistency in i3c_master_register
[ Upstream commit 9d4f219 ]
In `i3c_master_register`, a possible refcount inconsistency has been
identified, causing possible resource leak.
Function `of_node_get` increases the refcount of `parent->of_node`. If
function `i3c_bus_init` fails, the function returns immediately without
a corresponding decrease, resulting in an inconsistent refcounter.
Move call i3c_bus_init() after device_initialize() to let callback
i3c_masterdev_release() release of_node.
Reported-by: Shuhao Fu <sfual@cse.ust.hk>
Closes: https://lore.kernel.org/linux-i3c/aO2tjp_FsV_WohPG@osx.local/T/#m2c05a982beeb14e7bf039c1d8db856734bf234c7
Fixes: 3a379bb ("i3c: Add core I3C infrastructure")
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251016143814.2551256-1-Frank.Li@nxp.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 6b860ae commit d3bacdd
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2809 | 2809 | | |
2810 | 2810 | | |
2811 | 2811 | | |
2812 | | - | |
2813 | | - | |
2814 | | - | |
2815 | | - | |
2816 | 2812 | | |
2817 | 2813 | | |
2818 | 2814 | | |
2819 | 2815 | | |
2820 | 2816 | | |
2821 | 2817 | | |
2822 | 2818 | | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
2823 | 2823 | | |
2824 | 2824 | | |
2825 | 2825 | | |
| |||
0 commit comments