Commit bd1a6e33 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman

regulator: of: Add a missing 'of_node_put()' in an error handling path of 'of_regulator_match()'

[ Upstream commit 30966861 ]

If an unlikely failure in 'of_get_regulator_init_data()' occurs, we must
release the reference on the current 'child' node before returning.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 36016bab
......@@ -305,6 +305,7 @@ int of_regulator_match(struct device *dev, struct device_node *node,
dev_err(dev,
"failed to parse DT for regulator %s\n",
child->name);
of_node_put(child);
return -EINVAL;
}
match->of_node = of_node_get(child);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment