mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 13:03:25 +01:00
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
commit
21dcd49fb4
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue