Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=93e4fd455c62085cdceea3af4c56d95758d3cb74
Commit:     93e4fd455c62085cdceea3af4c56d95758d3cb74
Parent:     3964a4496eaa4cb84772e8dfc6c3a72ec4ddca7a
Author:     Kristian Høgsberg <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 27 09:42:39 2007 -0500
Committer:  Stefan Richter <[EMAIL PROTECTED]>
CommitDate: Wed Mar 28 21:30:15 2007 +0200

    firewire: Don't set card->irm_node before we have a new valid topology.
    
    In case the topology build fails, we want to retain the old topology
    info until another reset finishes and results in a valid new tree.  If
    we clear card->irm_node to NULL and the topology build fails, we end up
    dereferencing a NULL pointer in a few places.
    
    Signed-off-by: Kristian Høgsberg <[EMAIL PROTECTED]>
    Signed-off-by: Stefan Richter <[EMAIL PROTECTED]>
---
 drivers/firewire/fw-topology.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/firewire/fw-topology.c b/drivers/firewire/fw-topology.c
index 7923463..bc8a348 100644
--- a/drivers/firewire/fw-topology.c
+++ b/drivers/firewire/fw-topology.c
@@ -166,7 +166,7 @@ static void update_hop_count(struct fw_node *node)
 static struct fw_node *build_tree(struct fw_card *card,
                                  u32 *sid, int self_id_count)
 {
-       struct fw_node *node, *child, *local_node;
+       struct fw_node *node, *child, *local_node, *irm_node;
        struct list_head stack, *h;
        u32 *next_sid, *end, q;
        int i, port_count, child_port_count, phy_id, parent_count, stack_depth;
@@ -178,7 +178,7 @@ static struct fw_node *build_tree(struct fw_card *card,
        stack_depth = 0;
        end = sid + self_id_count;
        phy_id = 0;
-       card->irm_node = NULL;
+       irm_node = NULL;
        gap_count = self_id_gap_count(*sid);
        topology_type = 0;
 
@@ -218,7 +218,7 @@ static struct fw_node *build_tree(struct fw_card *card,
                        local_node = node;
 
                if (self_id_contender(q))
-                       card->irm_node = node;
+                       irm_node = node;
 
                if (node->phy_speed == SCODE_BETA)
                        topology_type |= FW_TOPOLOGY_B;
@@ -282,6 +282,7 @@ static struct fw_node *build_tree(struct fw_card *card,
        }
 
        card->root_node = node;
+       card->irm_node = irm_node;
        card->gap_count = gap_count;
        card->topology_type = topology_type;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to