aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_mem.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_mem.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_mem.c b/drivers/scsi/lpfc/lpfc_mem.c
index 27448c98c07a..3c0cebc71800 100644
--- a/drivers/scsi/lpfc/lpfc_mem.c
+++ b/drivers/scsi/lpfc/lpfc_mem.c
@@ -264,18 +264,27 @@ void
264lpfc_in_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp) 264lpfc_in_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp)
265{ 265{
266 struct hbq_dmabuf *hbq_entry; 266 struct hbq_dmabuf *hbq_entry;
267 unsigned long flags;
267 268
268 if (!mp) 269 if (!mp)
269 return; 270 return;
270 271
271 if (phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) { 272 if (phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) {
273 /* Check whether HBQ is still in use */
274 spin_lock_irqsave(&phba->hbalock, flags);
275 if (!phba->hbq_in_use) {
276 spin_unlock_irqrestore(&phba->hbalock, flags);
277 return;
278 }
272 hbq_entry = container_of(mp, struct hbq_dmabuf, dbuf); 279 hbq_entry = container_of(mp, struct hbq_dmabuf, dbuf);
280 list_del(&hbq_entry->dbuf.list);
273 if (hbq_entry->tag == -1) { 281 if (hbq_entry->tag == -1) {
274 (phba->hbqs[LPFC_ELS_HBQ].hbq_free_buffer) 282 (phba->hbqs[LPFC_ELS_HBQ].hbq_free_buffer)
275 (phba, hbq_entry); 283 (phba, hbq_entry);
276 } else { 284 } else {
277 lpfc_sli_free_hbq(phba, hbq_entry); 285 lpfc_sli_free_hbq(phba, hbq_entry);
278 } 286 }
287 spin_unlock_irqrestore(&phba->hbalock, flags);
279 } else { 288 } else {
280 lpfc_mbuf_free(phba, mp->virt, mp->phys); 289 lpfc_mbuf_free(phba, mp->virt, mp->phys);
281 kfree(mp); 290 kfree(mp);