diff options
author | Steve Holland <sdh4@iastate.edu> | 2009-06-18 18:37:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-23 09:46:35 -0400 |
commit | c2cd26e15b84b964c489f2aff278cdaf03840c93 (patch) | |
tree | 64a51e7f5da2e03d316d2ad1b607b35f2b36ccc4 /drivers/usb/class | |
parent | 492896f011a411d17d02e696adbc4a9b4ff68e7f (diff) |
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: Steve Holland <sdh4@iastate.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r-- | drivers/usb/class/usbtmc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 40ef4da786d8..f2fde7cd6109 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -407,10 +407,10 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf, | |||
407 | buffer[1] = data->bTag; | 407 | buffer[1] = data->bTag; |
408 | buffer[2] = ~(data->bTag); | 408 | buffer[2] = ~(data->bTag); |
409 | buffer[3] = 0; /* Reserved */ | 409 | buffer[3] = 0; /* Reserved */ |
410 | buffer[4] = (this_part - 12 - 3) & 255; | 410 | buffer[4] = (this_part) & 255; |
411 | buffer[5] = ((this_part - 12 - 3) >> 8) & 255; | 411 | buffer[5] = ((this_part) >> 8) & 255; |
412 | buffer[6] = ((this_part - 12 - 3) >> 16) & 255; | 412 | buffer[6] = ((this_part) >> 16) & 255; |
413 | buffer[7] = ((this_part - 12 - 3) >> 24) & 255; | 413 | buffer[7] = ((this_part) >> 24) & 255; |
414 | buffer[8] = data->TermCharEnabled * 2; | 414 | buffer[8] = data->TermCharEnabled * 2; |
415 | /* Use term character? */ | 415 | /* Use term character? */ |
416 | buffer[9] = data->TermChar; | 416 | buffer[9] = data->TermChar; |