aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-03-19 17:05:02 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2008-04-18 11:55:34 -0400
commit016bf3dfcf7c7fbad8f02e72b6e01d6773426f9d (patch)
tree844a04d866b5b0d5eccdb795ad7e6c9fc79f3f2c /drivers/firewire
parentc8a9a498e16b2a6c0e4e367b1a01f80fdfd7b6e2 (diff)
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: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jarod Wilson <jwilson@redhat.com>
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/fw-ohci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 1f6f15f0dce..0c4a07f11a5 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1031,6 +1031,10 @@ static void bus_reset_tasklet(unsigned long data)
1031 * bit extra to get the actual number of self IDs. 1031 * bit extra to get the actual number of self IDs.
1032 */ 1032 */
1033 self_id_count = (reg >> 3) & 0x3ff; 1033 self_id_count = (reg >> 3) & 0x3ff;
1034 if (self_id_count == 0) {
1035 fw_notify("inconsistent self IDs\n");
1036 return;
1037 }
1034 generation = (cond_le32_to_cpu(ohci->self_id_cpu[0]) >> 16) & 0xff; 1038 generation = (cond_le32_to_cpu(ohci->self_id_cpu[0]) >> 16) & 0xff;
1035 rmb(); 1039 rmb();
1036 1040