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:
Steve Holland 2009-06-18 17:37:49 -05:00 committed by Greg Kroah-Hartman
parent 92d07e422d
commit 4143d178e7
1 changed files with 2 additions and 1 deletions

View File

@ -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;