Skip to content
  • Stefan Richter's avatar
    firewire: fill_bus_reset_event needs lock protection · 5cb84067
    Stefan Richter authored
    
    
    Callers of fill_bus_reset_event() have to take card->lock.  Otherwise
    access to node data may oops if node removal is in progress.
    
    A lockless alternative would be
    
    -	event->local_node_id = card->local_node->node_id;
    +	tmp = fw_node_get(card->local_node);
    +	event->local_node_id = tmp->node_id;
    +	fw_node_put(tmp);
    
    and ditto with the other node pointers which fill_bus_reset_event()
    accesses.  But I went the locked route because one of the two callers
    already holds the lock.  As a bonus, we don't need the memory barrier
    anymore because device->generation and device->node_id are written in
    a card->lock protected section.
    
    Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
    Signed-off-by: default avatarKristian Høgsberg <krh@redhat.com>
    5cb84067