提交 4143d178 编写于 作者: S Steve Holland 提交者: 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: NSteve Holland <sdh4@iastate.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 92d07e42
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册