diff options
author | Steve Holland <sdh4@iastate.edu> | 2009-06-18 18:37:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-23 09:46:35 -0400 |
commit | 4143d178e7b39c00d5277040c69a1522c4d98871 (patch) | |
tree | 38f372250370761786701b5c93fa8a41699a43c1 /drivers/usb/class/usbtmc.c | |
parent | 92d07e422df3cc5370d0d9b95a671abb69d50ef1 (diff) |
USB: usbtmc: correct termination condition for reads.
Follow T&M convention of obeying EOM flag. Avoid exception cases where
instrument response size matches a buffer size.
Signed-off-by: Steve Holland <sdh4@iastate.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class/usbtmc.c')
-rw-r--r-- | drivers/usb/class/usbtmc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 91d3a94eeaa0..6395f22a58e1 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -485,7 +485,8 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf, | |||
485 | } | 485 | } |
486 | 486 | ||
487 | done += n_characters; | 487 | done += n_characters; |
488 | if (n_characters < USBTMC_SIZE_IOBUFFER) | 488 | /* Terminate if end-of-message bit recieved from device */ |
489 | if ((buffer[8] & 0x01) && (actual >= n_characters + 12)) | ||
489 | remaining = 0; | 490 | remaining = 0; |
490 | else | 491 | else |
491 | remaining -= n_characters; | 492 | remaining -= n_characters; |