]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi/lpfc: Fix null pointer error for piocbq
authorVaios Papadimitriou <vaios.papadimitriou@emulex.com>
Tue, 28 Aug 2012 23:03:38 +0000 (16:03 -0700)
committerJerry Snitselaar <jerry.snitselaar@oracle.com>
Wed, 5 Sep 2012 19:25:50 +0000 (12:25 -0700)
commit id: a629852ab810015223eec7a2f31a6bd5f93c83cf

Signed-off-by: Jerry Snitselaar <jerry.snitselaar@oracle.com>
drivers/scsi/lpfc/lpfc_sli.c

index b63e19822c60bd01a94c4418d44e2be71e07932d..748843416e9c4eceb3dcd0c3f508cb87acd62ed6 100644 (file)
@@ -15950,24 +15950,18 @@ lpfc_drain_txq(struct lpfc_hba *phba)
                spin_lock_irqsave(&phba->hbalock, iflags);
 
                piocbq = lpfc_sli_ringtx_get(phba, pring);
+               if (!piocbq) {
+                       spin_unlock_irqrestore(&phba->hbalock, iflags);
+                       lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
+                               "2823 txq empty and txq_cnt is %d\n ",
+                               pring->txq_cnt);
+                       break;
+               }
                sglq = __lpfc_sli_get_sglq(phba, piocbq);
                if (!sglq) {
                        __lpfc_sli_ringtx_put(phba, pring, piocbq);
                        spin_unlock_irqrestore(&phba->hbalock, iflags);
                        break;
-               } else {
-                       if (!piocbq) {
-                               /* The txq_cnt out of sync. This should
-                                * never happen
-                                */
-                               sglq = __lpfc_clear_active_sglq(phba,
-                                                sglq->sli4_lxritag);
-                               spin_unlock_irqrestore(&phba->hbalock, iflags);
-                               lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
-                                       "2823 txq empty and txq_cnt is %d\n ",
-                                       pring->txq_cnt);
-                               break;
-                       }
                }
 
                /* The xri and iocb resources secured,