File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -833,6 +833,7 @@ static ssize_t usbtmc_generic_read(struct usbtmc_file_data *file_data,
833
833
unsigned long expire ;
834
834
int bufcount = 1 ;
835
835
int again = 0 ;
836
+ long wait_rv ;
836
837
837
838
/* mutex already locked */
838
839
@@ -945,19 +946,24 @@ static ssize_t usbtmc_generic_read(struct usbtmc_file_data *file_data,
945
946
if (!(flags & USBTMC_FLAG_ASYNC )) {
946
947
dev_dbg (dev , "%s: before wait time %lu\n" ,
947
948
__func__ , expire );
948
- retval = wait_event_interruptible_timeout (
949
+ wait_rv = wait_event_interruptible_timeout (
949
950
file_data -> wait_bulk_in ,
950
951
usbtmc_do_transfer (file_data ),
951
952
expire );
952
953
953
- dev_dbg (dev , "%s: wait returned %d\n" ,
954
- __func__ , retval );
954
+ dev_dbg (dev , "%s: wait returned %ld\n" ,
955
+ __func__ , wait_rv );
956
+
957
+ if (wait_rv < 0 ) {
958
+ retval = wait_rv ;
959
+ goto error ;
960
+ }
955
961
956
- if (retval <= 0 ) {
957
- if (retval == 0 )
958
- retval = - ETIMEDOUT ;
962
+ if (wait_rv == 0 ) {
963
+ retval = - ETIMEDOUT ;
959
964
goto error ;
960
965
}
966
+
961
967
}
962
968
963
969
urb = usb_get_from_anchor (& file_data -> in_anchor );
You can’t perform that action at this time.
0 commit comments