提交 44b74d90 编写于 作者: C Clemens Ladisch 提交者: Stefan Richter

firewire: ohci: prevent starting of iso contexts with empty queue

If a misguided program tried to start an isochronous context before it
has queued any packets, the call would appear to succeed, but the
context would not actually go into the running state, and the OHCI
controller would then raise an unrecoverableError interrupt because the
first Z value is zero and thus invalid.  The driver logs such errors,
but there is no mechanism to report this back to the program.

Add an explicit check so that this error can be returned synchronously.
Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
上级 e81cbebd
...@@ -2706,6 +2706,10 @@ static int ohci_start_iso(struct fw_iso_context *base, ...@@ -2706,6 +2706,10 @@ static int ohci_start_iso(struct fw_iso_context *base,
u32 control = IR_CONTEXT_ISOCH_HEADER, match; u32 control = IR_CONTEXT_ISOCH_HEADER, match;
int index; int index;
/* the controller cannot start without any queued packets */
if (ctx->context.last->branch_address == 0)
return -ENODATA;
switch (ctx->base.type) { switch (ctx->base.type) {
case FW_ISO_CONTEXT_TRANSMIT: case FW_ISO_CONTEXT_TRANSMIT:
index = ctx - ohci->it_context_list; index = ctx - ohci->it_context_list;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册