Skip to content

Commit

Permalink
[SCSI] qla2xxx: Add checks for a valid fcport in dev-loss-tmo/termina…
Browse files Browse the repository at this point in the history
…te_rport_io callbacks.

Commit f78badb ([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>
  • Loading branch information
Seokmann Ju authored and James Bottomley committed Jan 25, 2009
1 parent 53303c4 commit 3c01b4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/scsi/qla2xxx/qla_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,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);

/*
Expand All @@ -1033,6 +1036,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).
Expand Down

0 comments on commit 3c01b4f

Please sign in to comment.