diff options
Diffstat (limited to 'drivers/firewire/fw-sbp2.c')
-rw-r--r-- | drivers/firewire/fw-sbp2.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index 5596df65c8ed..624ff3e082f6 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c | |||
@@ -650,13 +650,14 @@ static void sbp2_login(struct work_struct *work) | |||
650 | if (sbp2_send_management_orb(lu, node_id, generation, | 650 | if (sbp2_send_management_orb(lu, node_id, generation, |
651 | SBP2_LOGIN_REQUEST, lu->lun, &response) < 0) { | 651 | SBP2_LOGIN_REQUEST, lu->lun, &response) < 0) { |
652 | if (lu->retries++ < 5) { | 652 | if (lu->retries++ < 5) { |
653 | queue_delayed_work(sbp2_wq, &lu->work, | 653 | if (queue_delayed_work(sbp2_wq, &lu->work, |
654 | DIV_ROUND_UP(HZ, 5)); | 654 | DIV_ROUND_UP(HZ, 5))) |
655 | kref_get(&lu->tgt->kref); | ||
655 | } else { | 656 | } else { |
656 | fw_error("failed to login to %s LUN %04x\n", | 657 | fw_error("failed to login to %s LUN %04x\n", |
657 | unit->device.bus_id, lu->lun); | 658 | unit->device.bus_id, lu->lun); |
658 | kref_put(&lu->tgt->kref, sbp2_release_target); | ||
659 | } | 659 | } |
660 | kref_put(&lu->tgt->kref, sbp2_release_target); | ||
660 | return; | 661 | return; |
661 | } | 662 | } |
662 | 663 | ||
@@ -914,7 +915,9 @@ static void sbp2_reconnect(struct work_struct *work) | |||
914 | lu->retries = 0; | 915 | lu->retries = 0; |
915 | PREPARE_DELAYED_WORK(&lu->work, sbp2_login); | 916 | PREPARE_DELAYED_WORK(&lu->work, sbp2_login); |
916 | } | 917 | } |
917 | queue_delayed_work(sbp2_wq, &lu->work, DIV_ROUND_UP(HZ, 5)); | 918 | if (queue_delayed_work(sbp2_wq, &lu->work, DIV_ROUND_UP(HZ, 5))) |
919 | kref_get(&lu->tgt->kref); | ||
920 | kref_put(&lu->tgt->kref, sbp2_release_target); | ||
918 | return; | 921 | return; |
919 | } | 922 | } |
920 | 923 | ||