projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0591b14
)
regulator: core: fix module refcount leak in set_supply()
author
Yang Yingliang
<yangyingliang@huawei.com>
Thu, 1 Dec 2022 12:27:05 +0000
(20:27 +0800)
committer
Mark Brown
<broonie@kernel.org>
Thu, 1 Dec 2022 17:19:12 +0000
(17:19 +0000)
If create_regulator() fails in set_supply(), the module refcount
needs be put to keep refcount balanced.
Fixes:
e2c09ae7a74d
("regulator: core: Increase refcount for regulator supply's module")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link:
https://lore.kernel.org/r/20221201122706.4055992-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/regulator/core.c
b/drivers/regulator/core.c
index 866401f3fb108606a0c164c1593d733bc52abc8b..76630c2c41803e772f27de62527b57d13c4fc8f2 100644
(file)
--- a/
drivers/regulator/core.c
+++ b/
drivers/regulator/core.c
@@
-1646,6
+1646,7
@@
static int set_supply(struct regulator_dev *rdev,
rdev->supply = create_regulator(supply_rdev, &rdev->dev, "SUPPLY");
if (rdev->supply == NULL) {
+ module_put(supply_rdev->owner);
err = -ENOMEM;
return err;
}