Commit bd1828a3 authored by Dinghao Liu's avatar Dinghao Liu Committed by Zheng Zengkai
Browse files

i3c: Fix potential refcount leak in i3c_master_register_new_i3c_devs

stable inclusion
from stable-v6.6.2
commit e49a51a96b531f1b4bcd8d358e645b6c74ef67e6
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8IW7G

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e49a51a96b531f1b4bcd8d358e645b6c74ef67e6



--------------------------------

[ 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: 3a379bbc ("i3c: Add core I3C infrastructure")
Signed-off-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20230921082410.25548-1-dinghao.liu@zju.edu.cn


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 2a4191ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment