drivers: mcb: collected patches for 6.2
cover drivers: mcb: collected patches for 6.2
From: Johannes Thumshirn <[email protected]>
Hi Greg,
Here are the patches I've collected for drivers mcb for v6.2. Both fix problems in the error paths.
I'm sorry I know I'm ultra late with this.
Thanks,
Johannes
Yang Yingliang (1):
mcb: mcb-parse: fix error handing in chameleon_parse_gdd()
Zhengchao Shao (1):
drivers: mcb: fix resource leak in mcb_probe()
drivers/mcb/mcb-core.c | 4 +++- drivers/mcb/mcb-parse.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.37.3
PATCH 1/2 drivers: mcb: fix resource leak in mcb_probe()
From: Zhengchao Shao <[email protected]>
When probe hook function failed in mcb_probe(), it doesn't put the device. Compiled test only.
--- drivers/mcb/mcb-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mcb/mcb-core.c +3 -1
@@ -71,8 +71,10 @@ static int mcb_probe(struct device *dev)get_device (dev); ret = mdrv->probe (mdev, found_id); -if (ret) +if (ret) {module_put (carrier_mod); +put_device (dev); + }return ret; }
Signature · 1 line
2.37.3
PATCH 2/2 mcb: mcb-parse: fix error handing in chameleon_parse_gdd()
In reply to Johannes ThumshirnFrom: Yang Yingliang <[email protected]>
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().
--- drivers/mcb/mcb-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mcb/mcb-parse.c +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; }
Signature · 1 line
2.37.3