Skip to content

Commit 728ac33

Browse files
Yang Yinglianggregkh
authored andcommitted
mcb: mcb-parse: fix error handing in chameleon_parse_gdd()
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: 3764e82 ("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>
1 parent d723746 commit 728ac33

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mcb/mcb-parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static int chameleon_parse_gdd(struct mcb_bus *bus,
108108
return 0;
109109

110110
err:
111-
mcb_free_dev(mdev);
111+
put_device(&mdev->dev);
112112

113113
return ret;
114114
}

0 commit comments

Comments
 (0)