提交 eb9c5836 编写于 作者: M Matthias Fend 提交者: Greg Kroah-Hartman

USB: ffs-test: fix length argument of out function call

The out functions should only handle actual available data instead of the complete buffer.
Otherwise for example the ep0_consume function will report ghost events since it tries to decode
the complete buffer - which may contain partly invalid data.
Signed-off-by: NMatthias Fend <matthias.fend@wolfvision.net>
Cc: stable <stable@vger.kernel.org>
Acked-by: NMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ccd68bb8
...@@ -297,7 +297,7 @@ static void *start_thread_helper(void *arg) ...@@ -297,7 +297,7 @@ static void *start_thread_helper(void *arg)
ret = t->in(t, t->buf, t->buf_size); ret = t->in(t, t->buf, t->buf_size);
if (ret > 0) { if (ret > 0) {
ret = t->out(t, t->buf, t->buf_size); ret = t->out(t, t->buf, ret);
name = out_name; name = out_name;
op = "write"; op = "write";
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册