Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;