]>
Commit | Line | Data |
---|---|---|
48bb485e GKH |
1 | From eb9c5836384cd2a276254df6254ed71117983626 Mon Sep 17 00:00:00 2001 |
2 | From: Matthias Fend <Matthias.Fend@wolfvision.net> | |
3 | Date: Mon, 7 May 2012 14:37:30 +0200 | |
4 | Subject: USB: ffs-test: fix length argument of out function call | |
5 | ||
6 | From: Matthias Fend <Matthias.Fend@wolfvision.net> | |
7 | ||
8 | commit eb9c5836384cd2a276254df6254ed71117983626 upstream. | |
9 | ||
10 | The out functions should only handle actual available data instead of the complete buffer. | |
11 | Otherwise for example the ep0_consume function will report ghost events since it tries to decode | |
12 | the complete buffer - which may contain partly invalid data. | |
13 | ||
14 | Signed-off-by: Matthias Fend <matthias.fend@wolfvision.net> | |
15 | Acked-by: Michal Nazarewicz <mina86@mina86.com> | |
16 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
17 | ||
18 | --- | |
19 | tools/usb/ffs-test.c | 2 +- | |
20 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
21 | ||
22 | --- a/tools/usb/ffs-test.c | |
23 | +++ b/tools/usb/ffs-test.c | |
24 | @@ -324,7 +324,7 @@ static void *start_thread_helper(void *a | |
25 | ||
26 | ret = t->in(t, t->buf, t->buf_size); | |
27 | if (ret > 0) { | |
28 | - ret = t->out(t, t->buf, t->buf_size); | |
29 | + ret = t->out(t, t->buf, ret); | |
30 | name = out_name; | |
31 | op = "write"; | |
32 | } else { |