aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/lpfc/lpfc_mem.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-13 16:23:44 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-13 16:23:44 -0800
commite760e716d47b48caf98da348368fd41b4a9b9e7e (patch)
tree92d401fdbc618a4bdf4afe7ae5ee509e09dda0e6 /drivers/scsi/lpfc/lpfc_mem.c
parentb2e3e658b344c6bcfb8fb694100ab2f2b5b2edb0 (diff)
parent99109301d103fbf0de43fc5a580a406c12a501e0 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: [SCSI] gdth: update deprecated pci_find_device [SCSI] gdth: scan for scsi devices [SCSI] sym53c416: fix module parameters [SCSI] lpfc 8.2.5 : Update lpfc driver version to 8.2.5 [SCSI] lpfc 8.2.5 : Fix buffer leaks [SCSI] lpfc 8.2.5 : Miscellaneous discovery Fixes [SCSI] lpfc 8.2.5 : Add MSI-X single message support [SCSI] lpfc 8.2.5 : Miscellaneous Fixes [SCSI] lpfc 8.2.5 : Correct ndlp referencing issues [SCSI] update SG_ALL to avoid causing chaining [SCSI] aic94xx: fix ABORT_TASK define conflict [SCSI] fas216: Use scsi_eh API for REQUEST_SENSE invocation [SCSI] ses: fix memory leaks [SCSI] aacraid: informational sysfs value corrections [SCSI] mpt fusion: Request I/O resources only when required [SCSI] aacraid: ignore adapter reset check polarity [SCSI] aacraid: add optional MSI support [SCSI] mpt fusion: Avoid racing when mptsas and mptcl module are loaded in parallel [SCSI] MegaRAID driver management char device moved to misc [SCSI] advansys: fix overrun_buf aligned bug
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_mem.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_mem.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_mem.c b/drivers/scsi/lpfc/lpfc_mem.c
index 6dc5ab8d671..3c0cebc7180 100644
--- a/drivers/scsi/lpfc/lpfc_mem.c
+++ b/drivers/scsi/lpfc/lpfc_mem.c
@@ -264,19 +264,30 @@ void
lpfc_in_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp)
{
struct hbq_dmabuf *hbq_entry;
+ unsigned long flags;
+
+ if (!mp)
+ return;
if (phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) {
+ /* 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;
+ }
hbq_entry = container_of(mp, struct hbq_dmabuf, dbuf);
+ list_del(&hbq_entry->dbuf.list);
if (hbq_entry->tag == -1) {
(phba->hbqs[LPFC_ELS_HBQ].hbq_free_buffer)
(phba, hbq_entry);
} else {
lpfc_sli_free_hbq(phba, hbq_entry);
}
+ spin_unlock_irqrestore(&phba->hbalock, flags);
} else {
lpfc_mbuf_free(phba, mp->virt, mp->phys);
kfree(mp);
}
return;
}
-