diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2016-10-29 12:11:57 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-10-31 04:18:29 -0400 |
commit | 1b6998c96ccc60a61bdb812b4a55866224ab9708 (patch) | |
tree | 6bf43da7a24c39664b8a9898f7686bc73075c28f /drivers/gpio | |
parent | 5a195c6d4ecf43be26ee1c8be6140025832adfd2 (diff) |
ACPI / gpio: add missing fwnode_handle_put() in acpi_gpiochip_scan_gpios()
fwnode_handle_put() should be used when terminating
device_for_each_child_node() iteration with break or
return to prevent stale device node references from
being left behind.
This is detected by Coccinelle semantic patch.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpiolib-acpi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 53266ef12008..aa879d5eaa19 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c | |||
@@ -922,6 +922,7 @@ static void acpi_gpiochip_scan_gpios(struct acpi_gpio_chip *achip) | |||
922 | ret = gpiod_hog(desc, name, lflags, dflags); | 922 | ret = gpiod_hog(desc, name, lflags, dflags); |
923 | if (ret) { | 923 | if (ret) { |
924 | dev_err(chip->parent, "Failed to hog GPIO\n"); | 924 | dev_err(chip->parent, "Failed to hog GPIO\n"); |
925 | fwnode_handle_put(fwnode); | ||
925 | return; | 926 | return; |
926 | } | 927 | } |
927 | } | 928 | } |