diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2011-02-23 03:27:40 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-02-26 09:11:04 -0500 |
commit | 44b74d909dc943fd9384930a141450cb17133511 (patch) | |
tree | 19861b5b1213d6f0e9571f6c640095f7d74b642c /drivers/firewire | |
parent | e81cbebdfc384f9c2ae91225f16ef994118e5e2c (diff) |
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: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire')
-rw-r--r-- | drivers/firewire/ohci.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index f1497b1fcf2e..c0572283b93e 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -2706,6 +2706,10 @@ static int ohci_start_iso(struct fw_iso_context *base, | |||
2706 | u32 control = IR_CONTEXT_ISOCH_HEADER, match; | 2706 | u32 control = IR_CONTEXT_ISOCH_HEADER, match; |
2707 | int index; | 2707 | int index; |
2708 | 2708 | ||
2709 | /* the controller cannot start without any queued packets */ | ||
2710 | if (ctx->context.last->branch_address == 0) | ||
2711 | return -ENODATA; | ||
2712 | |||
2709 | switch (ctx->base.type) { | 2713 | switch (ctx->base.type) { |
2710 | case FW_ISO_CONTEXT_TRANSMIT: | 2714 | case FW_ISO_CONTEXT_TRANSMIT: |
2711 | index = ctx - ohci->it_context_list; | 2715 | index = ctx - ohci->it_context_list; |