Skip to content

Commit 2832493

Browse files
Peter Chengregkh
authored andcommitted
usb: misc: usbtest: usbtest_do_ioctl may return positive integer
For case 14 and case 21, their correct return value is the number of bytes transferred, so it is a positive integer. But in usbtest_ioctl, it takes non-zero as false return value for usbtest_do_ioctl, so it will treat the correct test as wrong test, then the time on tests will be the minus value. Signed-off-by: Peter Chen <[email protected]> Cc: stable <[email protected]> Fixes: 18fc4eb ("usb: misc: usbtest: Remove timeval usage") Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 07d316a commit 2832493

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/misc/usbtest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2602,7 +2602,7 @@ usbtest_ioctl(struct usb_interface *intf, unsigned int code, void *buf)
26022602
ktime_get_ts64(&start);
26032603

26042604
retval = usbtest_do_ioctl(intf, param_32);
2605-
if (retval)
2605+
if (retval < 0)
26062606
goto free_mutex;
26072607

26082608
ktime_get_ts64(&end);

0 commit comments

Comments
 (0)