[SCSI] bnx2fc: hold tgt lock when calling cmd_release
authorBhanu Prakash Gollapudi <bprakash@broadcom.com>
Wed, 27 Jul 2011 18:32:10 +0000 (11:32 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Thu, 28 Jul 2011 07:54:37 +0000 (11:54 +0400)
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/bnx2fc/bnx2fc_io.c

index 797b0051b6ff8750d0b203489c65ec7d5a345a32..7154c44fa2c98ac9e89ed7d0f6661988ca5822da 100644 (file)
@@ -752,7 +752,9 @@ retry_tmf:
        rc = bnx2fc_init_mp_req(io_req);
        if (rc == FAILED) {
                printk(KERN_ERR PFX "Task mgmt MP request init failed\n");
+               spin_lock_bh(&tgt->tgt_lock);
                kref_put(&io_req->refcount, bnx2fc_cmd_release);
+               spin_unlock_bh(&tgt->tgt_lock);
                goto tmf_err;
        }