mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
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: 3764e82e51 ("drivers: Introduce MEN Chameleon Bus")
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Yang Yingliang <[email protected]>
Signed-off-by: Johannes Thumshirn <[email protected]>
Link: https://lore.kernel.org/r/ebfb06e39b19272f0197fa9136b5e4b6f34ad732.1669624063.git.johannes.thumshirn@wdc.com
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
1 parent
d723746256
commit
728ac33892
1 file changed
+1
-1
@@ -108,7 +108,7 @@ static int chameleon_parse_gdd(struct mcb_bus *bus,
|
||||
return 0;
|
||||
|
||||
err:
|
||||
mcb_free_dev(mdev);
|
||||
put_device(&mdev->dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user