]> git.karo-electronics.de Git - mv-sheeva.git/commit
firewire: fw-sbp2: fix races
authorJay Fenlason <fenlason@redhat.com>
Fri, 24 Oct 2008 19:26:20 +0000 (15:26 -0400)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Sun, 26 Oct 2008 09:27:01 +0000 (10:27 +0100)
commitcd1f70fdb4823c97328a1f151f328eb36fafd579
tree43810548ecebf6bc8329a1c6454584d81151c758
parent0dcfeb7e3c8695c5aa3677dda8efb9bef2e7e64d
firewire: fw-sbp2: fix races

1: There is a small race between queue_delayed_work() and its
   corresponding kref_get().  Do the kref_get first, and _put it again
   if the queue_delayed_work() failed, so there is no chance of the
   kref going to zero while the work is scheduled.
2: An SBP2_LOGOUT_REQUEST could be sent out with a login_id full of
   garbage.  Initialize it to an invalid value so we can tell if we
   ever got a valid login_id.
3: The node ID and generation may have changed but the new values may
   not yet have been recorded in lu and tgt when the final logout is
   attempted.  Use the latest values from the device in
   sbp2_release_target().

Signed-off-by: Jay Fenlason <fenlason@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/fw-sbp2.c