Skip to contentSkip to conversation

usb: usbtmc: Add ioctls to set/get usb timeout

PATCH New Greg Kroah-Hartman 1 participant 1 message Jul 21, 2018 USB

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH v2 3/29 usb: usbtmc: Add ioctls to set/get usb timeout

Quoted 6 lines · Guido Kiener
(quoted diff) +6 -0
+/*
+ * Set the usb timeout value
+ */
+static int usbtmc_ioctl_set_timeout(struct usbtmc_file_data *file_data,
+				void __user *arg)
+{

Review

Quoted 10 lines
(quoted diff) +10 -0
+	u32 timeout;
+
+	if (get_user(timeout, (__u32 __user *)arg))
+		return -EFAULT;
+
+	/* Note that timeout = 0 means
+	 * MAX_SCHEDULE_TIMEOUT in usb_control_msg
+	 */
+	if (timeout < USBTMC_MIN_TIMEOUT)
+		return -EINVAL;

No max timeout limit? That feels odd, but ok, it's your api, you might be waiting a long time :)

thanks,

greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html