[SCSI] qla2xxx: Add checks for a valid fcport in dev-loss-tmo/terminate_rport_io callbacks.

Commit f78badb1ae07e7f8b835ab2ea0b456ed3fc4caf4 ([SCSI] fc
transport: pre-emptively terminate i/o upon dev_loss_tmo timeout)
changed the callback semantics of dev_loss_tmo and
terminate_rport_io such that repeated calls could be made. This
could result in the the driver using stale (NULLed-out, in
dev_loss_tmo) data from the rport. Correct this by addint a
simple check to ensure a valid fcport is attached.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

authored by Seokmann Ju and committed by James Bottomley 3c01b4f9 53303c42

+6
+6
drivers/scsi/qla2xxx/qla_attr.c
··· 1016 1016 struct Scsi_Host *host = rport_to_shost(rport); 1017 1017 fc_port_t *fcport = *(fc_port_t **)rport->dd_data; 1018 1018 1019 + if (!fcport) 1020 + return; 1021 + 1019 1022 qla2x00_abort_fcport_cmds(fcport); 1020 1023 1021 1024 /* ··· 1035 1032 qla2x00_terminate_rport_io(struct fc_rport *rport) 1036 1033 { 1037 1034 fc_port_t *fcport = *(fc_port_t **)rport->dd_data; 1035 + 1036 + if (!fcport) 1037 + return; 1038 1038 1039 1039 /* 1040 1040 * At this point all fcport's software-states are cleared. Perform any