From: Stefan Richter Date: Fri, 6 Jun 2008 20:11:30 +0000 (+0200) Subject: firewire: fill_bus_reset_event needs lock protection X-Git-Tag: v2.6.26-rc7~2^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cb84067d646fa3889463129dad8b218806b4698;p=pandora-kernel.git firewire: fill_bus_reset_event needs lock protection 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: Stefan Richter Signed-off-by: Kristian Høgsberg --- Reading git-diff-tree failed