Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=33f1c6c3529f5f279e2e98e5cca0c5bac152153b
Commit:     33f1c6c3529f5f279e2e98e5cca0c5bac152153b
Parent:     5513c5f6f9bd8c8ad3727130910fa288c62526a7
Author:     Stefan Richter <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 19 09:05:49 2008 +0100
Committer:  Stefan Richter <[EMAIL PROTECTED]>
CommitDate: Tue Feb 19 19:57:23 2008 +0100

    firewire: fw-sbp2: fix NULL pointer deref. in scsi_remove_device
    
    Fix a kernel bug when unplugging an SBP-2 device after having its
    scsi_device already removed via the "delete" sysfs attribute.
    
    Signed-off-by: Stefan Richter <[EMAIL PROTECTED]>
---
 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 60ebcb5..5259491 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)
        sbp2_unblock(tgt);
 
        list_for_each_entry_safe(lu, next, &tgt->lu_list, link) {
-               if (lu->sdev)
+               if (lu->sdev) {
                        scsi_remove_device(lu->sdev);
-
+                       scsi_device_put(lu->sdev);
+               }
                sbp2_send_management_orb(lu, tgt->node_id, lu->generation,
                                SBP2_LOGOUT_REQUEST, lu->login_id, NULL);
 
@@ -886,12 +887,11 @@ static void sbp2_login(struct work_struct *work)
        if (IS_ERR(sdev))
                goto out_logout_login;
 
-       scsi_device_put(sdev);
-
        /* Unreported error during __scsi_add_device() */
        smp_rmb(); /* get current card generation */
        if (generation != device->card->generation) {
                scsi_remove_device(sdev);
+               scsi_device_put(sdev);
                goto out_logout_login;
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to