lpfc: Fix crash in device reset handler.
authorJames Smart <james.smart@emulex.com>
Tue, 7 Apr 2015 19:07:26 +0000 (15:07 -0400)
committerJames Bottomley <JBottomley@Odin.com>
Fri, 10 Apr 2015 14:50:16 +0000 (07:50 -0700)
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/lpfc/lpfc_scsi.c

index 5612ba6bf213d7ef325491a0664817182cc04cc9..ea818f0ec218437d428880f25d9e9e3d1a9c7f84 100644 (file)
@@ -5118,9 +5118,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;