]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
i3c: Fix potential refcount leak in i3c_master_register_new_i3c_devs
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Thu, 21 Sep 2023 08:24:10 +0000 (16:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:57:18 +0000 (11:57 +0100)
commitb24cf43d9babf1265a2bb0ae8d198267cef43b83
tree10aa02456d0243664aeb6af79c2c88d5de679d25
parentbcf5e18c0beb73f53566b1903349b8e29bf81e19
i3c: Fix potential refcount leak in i3c_master_register_new_i3c_devs

[ Upstream commit cab63f64887616e3c4e31cfd8103320be6ebc8d3 ]

put_device() needs to be called on failure of device_register()
to give up the reference initialized in it to avoid refcount leak.

Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20230921082410.25548-1-dinghao.liu@zju.edu.cn
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i3c/master.c