projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
gpio: GPIO_GET_LINEHANDLE_IOCTL: Validate line offset
[cascardo/linux.git]
/
drivers
/
gpio
/
gpiolib.c
diff --git
a/drivers/gpio/gpiolib.c
b/drivers/gpio/gpiolib.c
index
7a01969
..
d287cb4
100644
(file)
--- a/
drivers/gpio/gpiolib.c
+++ b/
drivers/gpio/gpiolib.c
@@
-444,6
+444,11
@@
static int linehandle_create(struct gpio_device *gdev, void __user *ip)
u32 lflags = handlereq.flags;
struct gpio_desc *desc;
+ if (offset >= gdev->ngpio) {
+ ret = -EINVAL;
+ goto out_free_descs;
+ }
+
desc = &gdev->descs[offset];
ret = gpiod_request(desc, lh->label);
if (ret)