summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-05 16:09:11 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-05 16:09:11 -0700
commit3830711f3e93b056e3e3597f2b39da2df4636e0b (patch)
treea2c8a053824bfb2bd179920daf705ce0a5ff8b4e
parent5aebc7d2780df9176ee92f6d3bfd54b04457e349 (diff)
parent19a4fbffc94e41abaa2a623a25ce2641d69eccf0 (diff)
downloadlinux-3830711f3e93b056e3e3597f2b39da2df4636e0b.tar.bz2
Merge tag 'gpio-v4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Linus writes: "A single GPIO fix: Free the last used descriptor, an off by one error. This is tagged for stable as well." * tag 'gpio-v4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpiolib: Free the last requested descriptor
-rw-r--r--drivers/gpio/gpiolib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index e8f8a1999393..a57300c1d649 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -571,7 +571,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)
if (ret)
goto out_free_descs;
lh->descs[i] = desc;
- count = i;
+ count = i + 1;
if (lflags & GPIOHANDLE_REQUEST_ACTIVE_LOW)
set_bit(FLAG_ACTIVE_LOW, &desc->flags);