summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-04-08 15:48:11 +0200
committerLinus Walleij <linus.walleij@linaro.org>2019-04-08 15:48:11 +0200
commit4779a066e71dee0784e09eeebb57dcd56cb7c7f6 (patch)
tree2d45d7823ebeb4cfe069c30aeac2661352c69267 /drivers/gpio/gpiolib.c
parent12f2639038ef420fe796171ffb810b30d1ac0619 (diff)
parentb0d2569d8276439eb3d6f7d221f47bfc503ae00e (diff)
Merge tag 'gpio-v5.2-updates-for-linus-part1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel
gpio: updates for v5.2 (part 1) - batch of improvements for the vf610 driver which shrink the code and make use of resource managed helpers - support for a new variant of pca953x - make gpio-mockup buildable on systems without IOMEM - make gpio-74x164 more flexible by using generic device properties plus minor improvements - new driver for Mellanox BlueField - fixes for wakeup GPIOs in gpio-omap - use devm_platform_ioremap_resource() in gpio-mxc - a couple improvements of kernel docs for ACPI code - don't WARN() in gpiod_put() on optional GPIOs
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index cb0ffe7fb27e..982845e8212c 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -4626,7 +4626,8 @@ EXPORT_SYMBOL_GPL(gpiod_get_array_optional);
*/
void gpiod_put(struct gpio_desc *desc)
{
- gpiod_free(desc);
+ if (desc)
+ gpiod_free(desc);
}
EXPORT_SYMBOL_GPL(gpiod_put);