projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
216437d
)
drivers: mcb: fix resource leak in mcb_probe()
author
Zhengchao Shao
<shaozhengchao@huawei.com>
Fri, 2 Dec 2022 09:38:49 +0000
(
01:38
-0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:41 +0000
(13:32 +0100)
[ Upstream commit
d7237462561fcd224fa687c56ccb68629f50fc0d
]
When probe hook function failed in mcb_probe(), it doesn't put the device.
Compiled test only.
Fixes: 7bc364097a89 ("mcb: Acquire reference to device in probe")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: Johannes Thumshirn <jth@kernel.org>
Link:
https://lore.kernel.org/r/9f87de36bfb85158b506cb78c6fc9db3f6a3bad1.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-core.c
patch
|
blob
|
history
diff --git
a/drivers/mcb/mcb-core.c
b/drivers/mcb/mcb-core.c
index 338fc889b357a9f99de4d1177642a577686709a4..b8ad4f16b4acdc516e3733903dcdd6f42c00b146 100644
(file)
--- a/
drivers/mcb/mcb-core.c
+++ b/
drivers/mcb/mcb-core.c
@@
-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;
}