]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.0.33/usb-ffs-test-fix-length-argument-of-out-function-call.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 3.0.33 / usb-ffs-test-fix-length-argument-of-out-function-call.patch
CommitLineData
48bb485e
GKH
1From eb9c5836384cd2a276254df6254ed71117983626 Mon Sep 17 00:00:00 2001
2From: Matthias Fend <Matthias.Fend@wolfvision.net>
3Date: Mon, 7 May 2012 14:37:30 +0200
4Subject: USB: ffs-test: fix length argument of out function call
5
6From: Matthias Fend <Matthias.Fend@wolfvision.net>
7
8commit eb9c5836384cd2a276254df6254ed71117983626 upstream.
9
10The out functions should only handle actual available data instead of the complete buffer.
11Otherwise for example the ep0_consume function will report ghost events since it tries to decode
12the complete buffer - which may contain partly invalid data.
13
14Signed-off-by: Matthias Fend <matthias.fend@wolfvision.net>
15Acked-by: Michal Nazarewicz <mina86@mina86.com>
16Signed-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 {