]> git.baikalelectronics.ru Git - kernel.git/commit
mcb: mcb-parse: fix error handing in chameleon_parse_gdd()
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 2 Dec 2022 09:38:50 +0000 (01:38 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:25 +0000 (11:41 +0100)
commit7ef20f5252eea45a47a9e7bb0c060193e8041d8d
tree548fb3b8ca5189a1393009f8eade33ee34231ec0
parentdd7bd3c7ef88b0c11def65367eadc821d9f2b137
mcb: mcb-parse: fix error handing in chameleon_parse_gdd()

[ Upstream commit bdb47fcc7887e929d7dd65b740b8395f81124d3c ]

If mcb_device_register() returns error in chameleon_parse_gdd(), the refcount
of bus and device name are leaked. Fix this by calling put_device() to give up
the reference, so they can be released in mcb_release_dev() and kobject_cleanup().

Fixes: 2f3809d806b0 ("drivers: Introduce MEN Chameleon Bus")
Reviewed-by: Johannes Thumshirn <jth@kernel.org>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Johannes Thumshirn <jth@kernel.org>
Link: https://lore.kernel.org/r/ebfb06e39b19272f0197fa9136b5e4b6f34ad732.1669624063.git.johannes.thumshirn@wdc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mcb/mcb-parse.c