Commit 21dcd49f authored by Andy Shevchenko's avatar Andy Shevchenko
Browse files

Merge patch series "pinctrl: intel: platform: fix error path in device_for_each_child_node()"

Javier Carrasco <javier.carrasco.cruz@gmail.com> says:

This series fixes an error path where the reference of a child node is
not decremented upon early return. When at it, a trivial comma/semicolon
substitution I found by chance has been added to improve code clarity.

Link: https://lore.kernel.org/r/20240926-intel-pinctrl-platform-scoped-v1-0-5ee4c936eea3@gmail.com


Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parents 9852d85e d594de89
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -90,7 +90,6 @@ static int intel_platform_pinctrl_prepare_community(struct device *dev,
						    struct intel_community *community,
						    struct intel_platform_pins *pins)
{
	struct fwnode_handle *child;
	struct intel_padgroup *gpps;
	unsigned int group;
	size_t ngpps;
@@ -131,7 +130,7 @@ static int intel_platform_pinctrl_prepare_community(struct device *dev,
		return -ENOMEM;

	group = 0;
	device_for_each_child_node(dev, child) {
	device_for_each_child_node_scoped(dev, child) {
		struct intel_padgroup *gpp = &gpps[group];

		gpp->reg_num = group;
@@ -159,7 +158,7 @@ static int intel_platform_pinctrl_prepare_soc_data(struct device *dev,
	int ret;

	/* Version 1.0 of the specification assumes only a single community per device node */
	ncommunities = 1,
	ncommunities = 1;
	communities = devm_kcalloc(dev, ncommunities, sizeof(*communities), GFP_KERNEL);
	if (!communities)
		return -ENOMEM;