summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorJames Smart2012-06-12 19:54:11 +0200
committerJames Bottomley2012-07-20 09:58:26 +0200
commita629852ab810015223eec7a2f31a6bd5f93c83cf (patch)
tree8e180ce4b562ad0191aefc51c958bff2f1813baa /drivers/scsi/lpfc
parent[SCSI] lpfc 8.3.32: lpfc_sli.c: add missing jumps to mempool_free (diff)
downloadkernel-qcow2-linux-a629852ab810015223eec7a2f31a6bd5f93c83cf.tar.gz
kernel-qcow2-linux-a629852ab810015223eec7a2f31a6bd5f93c83cf.tar.xz
kernel-qcow2-linux-a629852ab810015223eec7a2f31a6bd5f93c83cf.zip
[SCSI] lpfc 8.3.32: Correct null pointer Error in lpfc_sli.c
This patch corrects the issue caught via Smatch and reported by Dan Carpenter: http://marc.info/?l=linux-scsi&m=133693516103343 Resolve null pointer check ordering that were odd Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index aace596887e6..3e4f8eaa1fb8 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -15863,24 +15863,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,