From b02fc5468e249507d1d5bfc98f9c04ae7c5fa541 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 3 Nov 2010 13:29:10 +0000 Subject: [PATCH] Mainline commit 3c01b4f9fbb43fc911acd33ea7a14ea7a4f9866b: From: Seokmann Ju Date: Thu, 22 Jan 2009 09:45:38 -0800 Subject: [PATCH] [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 Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2582 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla_attr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qla2x00t/qla_attr.c b/qla2x00t/qla_attr.c index 22bbe5e0b..98485a0e4 100644 --- a/qla2x00t/qla_attr.c +++ b/qla2x00t/qla_attr.c @@ -1598,6 +1598,9 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport) struct Scsi_Host *host = rport_to_shost(rport); fc_port_t *fcport = *(fc_port_t **)rport->dd_data; + if (!fcport) + return; + qla2x00_abort_fcport_cmds(fcport); /* @@ -1615,6 +1618,9 @@ qla2x00_terminate_rport_io(struct fc_rport *rport) { fc_port_t *fcport = *(fc_port_t **)rport->dd_data; + if (!fcport) + return; + qla2x00_abort_fcport_cmds(fcport); scsi_target_unblock(&rport->dev); }