Skip to contentSkip to conversation

lpfc: Fix crash in device reset handler.

PATCH In review James Smart 1 participant 1 message Feb 5, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 18/21 lpfc: Fix crash in device reset handler.

---
 drivers/scsi/lpfc/lpfc_scsi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_scsi.c +3 -2
index 9ed5f44..fbdc39c 100644
@@ -5464,9 +5464,10 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
 	int status;
 
 	rdata = lpfc_rport_data_from_scsi_device(cmnd->device);
-	if (!rdata) {
+	if (!rdata || !rdata->pnode) {
 		lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
-			"0798 Device Reset rport failure: rdata x%p\n", rdata);
+				 "0798 Device Reset rport failure: rdata x%p\n",
+				 rdata);
 		return FAILED;
 	}
 	pnode = rdata->pnode;
Signature · 4 lines
1.7.11.7

Signed-off-by: James Smart <[email protected]>
Signed-off-by: Dick Kennedy <[email protected]>