Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1422996 > unrolled thread

[PATCH] lpfc: Fix possible NULL pointer dereference

Started byJohannes Thumshirn <jthumshirn@suse.de>
First post2016-06-15 15:10 +0200
Last post2016-06-15 15:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] lpfc: Fix possible NULL pointer dereference Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-15 15:10 +0200

#1422996 — [PATCH] lpfc: Fix possible NULL pointer dereference

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2016-06-15 15:10 +0200
Subject[PATCH] lpfc: Fix possible NULL pointer dereference
Message-ID<rKiJX-2Ya-21@gated-at.bofh.it>
Check for the existance of pciob->vport before accessing it.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/scsi/lpfc/lpfc_sli.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 70edf21..134078f 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -1329,15 +1329,10 @@ lpfc_sli_ringtxcmpl_put(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
 	if ((unlikely(pring->ringno == LPFC_ELS_RING)) &&
 	   (piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) &&
 	   (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN) &&
-	 (!(piocb->vport->load_flag & FC_UNLOADING))) {
-		if (!piocb->vport)
-			BUG();
-		else
-			mod_timer(&piocb->vport->els_tmofunc,
-				jiffies +
-				msecs_to_jiffies(1000 * (phba->fc_ratov << 1)));
-	}
-
+	    piocb->vport && !(piocb->vport->load_flag & FC_UNLOADING))
+		mod_timer(&piocb->vport->els_tmofunc,
+			  jiffies +
+			  msecs_to_jiffies(1000 * (phba->fc_ratov << 1)));
 
 	return 0;
 }
-- 
1.8.5.6

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web