• Jay Fenlason's avatar
    firewire: fw-sbp2: fix races · cd1f70fd
    Jay Fenlason authored
    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: default avatarJay Fenlason <fenlason@redhat.com>
    Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
    cd1f70fd
fw-sbp2.c 47.2 KB