|
@@ -449,7 +449,13 @@ static long linehandle_ioctl(struct file *filep, unsigned int cmd,
|
|
|
|
|
|
return 0;
|
|
|
} else if (cmd == GPIOHANDLE_SET_LINE_VALUES_IOCTL) {
|
|
|
- /* TODO: check if descriptors are really output */
|
|
|
+ /*
|
|
|
+ * All line descriptors were created at once with the same
|
|
|
+ * flags so just check if the first one is really output.
|
|
|
+ */
|
|
|
+ if (!test_bit(FLAG_IS_OUT, &lh->descs[0]->flags))
|
|
|
+ return -EPERM;
|
|
|
+
|
|
|
if (copy_from_user(&ghd, ip, sizeof(ghd)))
|
|
|
return -EFAULT;
|
|
|
|