From 159c5e2fff12fc75220597fa2434ab0d0c07b337 Mon Sep 17 00:00:00 2001 From: Seokmann Ju Date: Thu, 22 Jan 2009 10:25:39 -0800 Subject: [PATCH] qla2xxx: added to check fcport is valid in qla2x00_terminate_rport_io(). References: bnc#467624 As to follow the recent changes in FC transport layer, qla2xxx module added a checker to make sure that fcport is being accessed is valid. - qla2x00_dev_loss_tmo_callbk() - qla2x00_terminate_rport_io() Following is SHA # for the FC transport layer changes, [SCSI] fc transport: pre-emptively terminate i/o upon dev_loss_tmo timeout (f78badb1ae07e7f8b835ab2ea0b456ed3fc4caf4) With the FC transport layer change, there is a possibility for qla2xxx module to take both dev_loss_tmo_callbk() and terminate_rport_io() repeatedly for a fcport, so that the checker is needed to make sure that the module won't access fcport if it has done so. Signed-off-by: Seokmann Ju Signed-off-by: Hannes Reinecke --- drivers/scsi/qla2xxx/qla_attr.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 6d5210e..34c4016 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1284,6 +1284,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); /* @@ -1301,6 +1304,9 @@ qla2x00_terminate_rport_io(struct fc_rport *rport) { fc_port_t *fcport = *(fc_port_t **)rport->dd_data; + if (!fcport) + return; + /* * At this point all fcport's software-states are cleared. Perform any * final cleanup of firmware resources (PCBs and XCBs). -- 1.6.0