Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eafe1df9e311034cce204e43c0e45c91723b802f
Commit:     eafe1df9e311034cce204e43c0e45c91723b802f
Parent:     65fecc77f3c47c5e8758d133b8ec47dcc16ed207
Author:     Matthew Wilcox <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 21 05:44:33 2008 -0700
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Fri Feb 22 17:15:35 2008 -0600

    [SCSI] lpfc: Balance locking
    
    Commit 3163f725a5d071eea1830bbbfab78cfe3fc9baaf introduced locking in
    lpfc_sli_hbqbuf_fill_hbqs, but missed unlocking on one exit.
    
    Reported-by: Harvey Harrison <[EMAIL PROTECTED]>
    Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]>
    Acked-by: James Smart <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/scsi/lpfc/lpfc_sli.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index f532064..fc0d950 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -648,28 +648,24 @@ lpfc_sli_hbqbuf_fill_hbqs(struct lpfc_hba *phba, uint32_t 
hbqno, uint32_t count)
        unsigned long flags;
        struct hbq_dmabuf *hbq_buffer;
 
-       if (!phba->hbqs[hbqno].hbq_alloc_buffer) {
+       if (!phba->hbqs[hbqno].hbq_alloc_buffer)
                return 0;
-       }
 
        start = phba->hbqs[hbqno].buffer_count;
        end = count + start;
-       if (end > lpfc_hbq_defs[hbqno]->entry_count) {
+       if (end > lpfc_hbq_defs[hbqno]->entry_count)
                end = lpfc_hbq_defs[hbqno]->entry_count;
-       }
 
        /* Check whether HBQ is still in use */
        spin_lock_irqsave(&phba->hbalock, flags);
-       if (!phba->hbq_in_use) {
-               spin_unlock_irqrestore(&phba->hbalock, flags);
-               return 0;
-       }
+       if (!phba->hbq_in_use)
+               goto out;
 
        /* Populate HBQ entries */
        for (i = start; i < end; i++) {
                hbq_buffer = (phba->hbqs[hbqno].hbq_alloc_buffer)(phba);
                if (!hbq_buffer)
-                       return 1;
+                       goto err;
                hbq_buffer->tag = (i | (hbqno << 16));
                if (lpfc_sli_hbq_to_firmware(phba, hbqno, hbq_buffer))
                        phba->hbqs[hbqno].buffer_count++;
@@ -677,8 +673,12 @@ lpfc_sli_hbqbuf_fill_hbqs(struct lpfc_hba *phba, uint32_t 
hbqno, uint32_t count)
                        (phba->hbqs[hbqno].hbq_free_buffer)(phba, hbq_buffer);
        }
 
+ out:
        spin_unlock_irqrestore(&phba->hbalock, flags);
        return 0;
+ err:
+       spin_unlock_irqrestore(&phba->hbalock, flags);
+       return 1;
 }
 
 int
-
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