diff options
-rw-r--r-- | drivers/firewire/fw-sbp2.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index 60ebcb5fe21a..5259491580fc 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c | |||
@@ -762,9 +762,10 @@ static void sbp2_release_target(struct kref *kref) | |||
762 | sbp2_unblock(tgt); | 762 | sbp2_unblock(tgt); |
763 | 763 | ||
764 | list_for_each_entry_safe(lu, next, &tgt->lu_list, link) { | 764 | list_for_each_entry_safe(lu, next, &tgt->lu_list, link) { |
765 | if (lu->sdev) | 765 | if (lu->sdev) { |
766 | scsi_remove_device(lu->sdev); | 766 | scsi_remove_device(lu->sdev); |
767 | 767 | scsi_device_put(lu->sdev); | |
768 | } | ||
768 | sbp2_send_management_orb(lu, tgt->node_id, lu->generation, | 769 | sbp2_send_management_orb(lu, tgt->node_id, lu->generation, |
769 | SBP2_LOGOUT_REQUEST, lu->login_id, NULL); | 770 | SBP2_LOGOUT_REQUEST, lu->login_id, NULL); |
770 | 771 | ||
@@ -886,12 +887,11 @@ static void sbp2_login(struct work_struct *work) | |||
886 | if (IS_ERR(sdev)) | 887 | if (IS_ERR(sdev)) |
887 | goto out_logout_login; | 888 | goto out_logout_login; |
888 | 889 | ||
889 | scsi_device_put(sdev); | ||
890 | |||
891 | /* Unreported error during __scsi_add_device() */ | 890 | /* Unreported error during __scsi_add_device() */ |
892 | smp_rmb(); /* get current card generation */ | 891 | smp_rmb(); /* get current card generation */ |
893 | if (generation != device->card->generation) { | 892 | if (generation != device->card->generation) { |
894 | scsi_remove_device(sdev); | 893 | scsi_remove_device(sdev); |
894 | scsi_device_put(sdev); | ||
895 | goto out_logout_login; | 895 | goto out_logout_login; |
896 | } | 896 | } |
897 | 897 | ||