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

USB: usbtmc: Fix short reads in usbtmc_read()

The header size should not be included in the number of bytes requested of the
instrument
Signed-off-by: default avatarSteve Holland <sdh4@iastate.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 492896f0
...@@ -407,10 +407,10 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf, ...@@ -407,10 +407,10 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf,
buffer[1] = data->bTag; buffer[1] = data->bTag;
buffer[2] = ~(data->bTag); buffer[2] = ~(data->bTag);
buffer[3] = 0; /* Reserved */ buffer[3] = 0; /* Reserved */
buffer[4] = (this_part - 12 - 3) & 255; buffer[4] = (this_part) & 255;
buffer[5] = ((this_part - 12 - 3) >> 8) & 255; buffer[5] = ((this_part) >> 8) & 255;
buffer[6] = ((this_part - 12 - 3) >> 16) & 255; buffer[6] = ((this_part) >> 16) & 255;
buffer[7] = ((this_part - 12 - 3) >> 24) & 255; buffer[7] = ((this_part) >> 24) & 255;
buffer[8] = data->TermCharEnabled * 2; buffer[8] = data->TermCharEnabled * 2;
/* Use term character? */ /* Use term character? */
buffer[9] = data->TermChar; buffer[9] = data->TermChar;
......
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