diff options
author | James Smart <james.smart@emulex.com> | 2012-06-12 13:54:11 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-07-20 03:58:26 -0400 |
commit | a629852ab810015223eec7a2f31a6bd5f93c83cf (patch) | |
tree | 8e180ce4b562ad0191aefc51c958bff2f1813baa /drivers/scsi/lpfc/lpfc_sli.c | |
parent | 4f4c18634d2a05079194ba333c7882349f25d6f7 (diff) |
[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/lpfc_sli.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 20 |
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) | |||
15863 | spin_lock_irqsave(&phba->hbalock, iflags); | 15863 | spin_lock_irqsave(&phba->hbalock, iflags); |
15864 | 15864 | ||
15865 | piocbq = lpfc_sli_ringtx_get(phba, pring); | 15865 | piocbq = lpfc_sli_ringtx_get(phba, pring); |
15866 | if (!piocbq) { | ||
15867 | spin_unlock_irqrestore(&phba->hbalock, iflags); | ||
15868 | lpfc_printf_log(phba, KERN_ERR, LOG_SLI, | ||
15869 | "2823 txq empty and txq_cnt is %d\n ", | ||
15870 | pring->txq_cnt); | ||
15871 | break; | ||
15872 | } | ||
15866 | sglq = __lpfc_sli_get_sglq(phba, piocbq); | 15873 | sglq = __lpfc_sli_get_sglq(phba, piocbq); |
15867 | if (!sglq) { | 15874 | if (!sglq) { |
15868 | __lpfc_sli_ringtx_put(phba, pring, piocbq); | 15875 | __lpfc_sli_ringtx_put(phba, pring, piocbq); |
15869 | spin_unlock_irqrestore(&phba->hbalock, iflags); | 15876 | spin_unlock_irqrestore(&phba->hbalock, iflags); |
15870 | break; | 15877 | break; |
15871 | } else { | ||
15872 | if (!piocbq) { | ||
15873 | /* The txq_cnt out of sync. This should | ||
15874 | * never happen | ||
15875 | */ | ||
15876 | sglq = __lpfc_clear_active_sglq(phba, | ||
15877 | sglq->sli4_lxritag); | ||
15878 | spin_unlock_irqrestore(&phba->hbalock, iflags); | ||
15879 | lpfc_printf_log(phba, KERN_ERR, LOG_SLI, | ||
15880 | "2823 txq empty and txq_cnt is %d\n ", | ||
15881 | pring->txq_cnt); | ||
15882 | break; | ||
15883 | } | ||
15884 | } | 15878 | } |
15885 | 15879 | ||
15886 | /* The xri and iocb resources secured, | 15880 | /* The xri and iocb resources secured, |