summaryrefslogtreecommitdiff
path: root/drivers/mcb/mcb-parse.c
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-12-02 12:38:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 11:26:24 +0300
commitcf6e70c0ced50b52415ac0c88eba1fb09c500a5a (patch)
tree64d7c95344ecdf64a5aeab57b2b734add69c6dfd /drivers/mcb/mcb-parse.c
parent6f3467aa5712e6b5550e75a16454b3f17aa1f380 (diff)
downloadlinux-cf6e70c0ced50b52415ac0c88eba1fb09c500a5a.tar.xz
mcb: mcb-parse: fix error handing in chameleon_parse_gdd()
[ Upstream commit 728ac3389296caf68638628c987aeae6c8851e2d ] 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: 3764e82e5150 ("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>
Diffstat (limited to 'drivers/mcb/mcb-parse.c')
-rw-r--r--drivers/mcb/mcb-parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c
index 7369bda3442f..3636349648b4 100644
--- a/drivers/mcb/mcb-parse.c
+++ b/drivers/mcb/mcb-parse.c
@@ -107,7 +107,7 @@ static int chameleon_parse_gdd(struct mcb_bus *bus,
return 0;
err:
- mcb_free_dev(mdev);
+ put_device(&mdev->dev);
return ret;
}