Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'regulator-fix-v6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fix from Mark Brown:
"One minor fix for a leak in the DT parsing code in the max20086 driver"

* tag 'regulator-fix-v6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
regulator: max20086: Fix refcount leak in max20086_parse_regulators_dt()

+3 -3
+3 -3
drivers/regulator/max20086-regulator.c
··· 5 5 // Copyright (C) 2022 Laurent Pinchart <laurent.pinchart@idesonboard.com> 6 6 // Copyright (C) 2018 Avnet, Inc. 7 7 8 + #include <linux/cleanup.h> 8 9 #include <linux/err.h> 9 10 #include <linux/gpio/consumer.h> 10 11 #include <linux/i2c.h> ··· 134 133 static int max20086_parse_regulators_dt(struct max20086 *chip, bool *boot_on) 135 134 { 136 135 struct of_regulator_match *matches; 137 - struct device_node *node; 138 136 unsigned int i; 139 137 int ret; 140 138 141 - node = of_get_child_by_name(chip->dev->of_node, "regulators"); 139 + struct device_node *node __free(device_node) = 140 + of_get_child_by_name(chip->dev->of_node, "regulators"); 142 141 if (!node) { 143 142 dev_err(chip->dev, "regulators node not found\n"); 144 143 return -ENODEV; ··· 154 153 155 154 ret = of_regulator_match(chip->dev, node, matches, 156 155 chip->info->num_outputs); 157 - of_node_put(node); 158 156 if (ret < 0) { 159 157 dev_err(chip->dev, "Failed to match regulators\n"); 160 158 return -EINVAL;