mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-18 15:09:53 +00:00
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>
This commit is contained in:
parent
92d07e422d
commit
4143d178e7
@ -485,7 +485,8 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf,
|
||||
}
|
||||
|
||||
done += n_characters;
|
||||
if (n_characters < USBTMC_SIZE_IOBUFFER)
|
||||
/* Terminate if end-of-message bit recieved from device */
|
||||
if ((buffer[8] & 0x01) && (actual >= n_characters + 12))
|
||||
remaining = 0;
|
||||
else
|
||||
remaining -= n_characters;
|
||||
|
Loading…
Reference in New Issue
Block a user