mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-11 23:27:42 +07:00
regulator: s5m8767: Drop regulators OF node reference
[ Upstream commit a5872bd3398d0ff2ce4c77794bc7837899c69024 ]
The device node reference obtained with of_get_child_by_name() should be
dropped on error paths.
Fixes: 26aec009f6
("regulator: add device tree support for s5m8767")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20210121155914.48034-1-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ac5ab9c029
commit
b1ff96e919
@ -544,14 +544,18 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
|
||||
rdata = devm_kcalloc(&pdev->dev,
|
||||
pdata->num_regulators, sizeof(*rdata),
|
||||
GFP_KERNEL);
|
||||
if (!rdata)
|
||||
if (!rdata) {
|
||||
of_node_put(regulators_np);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
rmode = devm_kcalloc(&pdev->dev,
|
||||
pdata->num_regulators, sizeof(*rmode),
|
||||
GFP_KERNEL);
|
||||
if (!rmode)
|
||||
if (!rmode) {
|
||||
of_node_put(regulators_np);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
pdata->regulators = rdata;
|
||||
pdata->opmode = rmode;
|
||||
|
Loading…
Reference in New Issue
Block a user