Commit 016bf3df authored by Stefan Richter's avatar Stefan Richter

firewire: fw-ohci: catch self_id_count == 0

fw_core_handle_bus_reset() incorrectly relied on the assumption that
self_id_count > 0.

We check early in fw-ohci and discard the self ID complete event if
self_id_count == 0 because a valid event always has at least one self ID
packet in it (the one of the local node).  Hence treat self_id_count ==
0 like any other kind of invalid self ID buffer.
Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: default avatarJarod Wilson <jwilson@redhat.com>
parent c8a9a498
...@@ -1031,6 +1031,10 @@ static void bus_reset_tasklet(unsigned long data) ...@@ -1031,6 +1031,10 @@ static void bus_reset_tasklet(unsigned long data)
* bit extra to get the actual number of self IDs. * bit extra to get the actual number of self IDs.
*/ */
self_id_count = (reg >> 3) & 0x3ff; self_id_count = (reg >> 3) & 0x3ff;
if (self_id_count == 0) {
fw_notify("inconsistent self IDs\n");
return;
}
generation = (cond_le32_to_cpu(ohci->self_id_cpu[0]) >> 16) & 0xff; generation = (cond_le32_to_cpu(ohci->self_id_cpu[0]) >> 16) & 0xff;
rmb(); rmb();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment