Commit 4143d178 authored by Steve Holland's avatar Steve Holland Committed by Greg Kroah-Hartman

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: default avatarSteve Holland <sdh4@iastate.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 92d07e42
...@@ -485,7 +485,8 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf, ...@@ -485,7 +485,8 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf,
} }
done += n_characters; 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; remaining = 0;
else else
remaining -= n_characters; remaining -= n_characters;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment