]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.fixes/qla2xxx-check-fc-rport-validity
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / qla2xxx-check-fc-rport-validity
1 From 159c5e2fff12fc75220597fa2434ab0d0c07b337 Mon Sep 17 00:00:00 2001
2 From: Seokmann Ju <sju@elab55.qlogic.com>
3 Date: Thu, 22 Jan 2009 10:25:39 -0800
4 Subject: [PATCH] qla2xxx: added to check fcport is valid in qla2x00_terminate_rport_io().
5 References: bnc#467624
6
7 As to follow the recent changes in FC transport layer, qla2xxx module
8 added a checker to make sure that fcport is being accessed is valid.
9 - qla2x00_dev_loss_tmo_callbk()
10 - qla2x00_terminate_rport_io()
11 Following is SHA # for the FC transport layer changes,
12 [SCSI] fc transport: pre-emptively terminate i/o upon dev_loss_tmo timeout
13 (f78badb1ae07e7f8b835ab2ea0b456ed3fc4caf4)
14 With the FC transport layer change, there is a possibility for qla2xxx
15 module to take both dev_loss_tmo_callbk() and terminate_rport_io() repeatedly
16 for a fcport, so that the checker is needed to make sure that the module
17 won't access fcport if it has done so.
18
19 Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
20 Signed-off-by: Hannes Reinecke <hare@suse.de>
21 ---
22 drivers/scsi/qla2xxx/qla_attr.c | 6 ++++++
23 1 files changed, 6 insertions(+), 0 deletions(-)
24
25 diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
26 index 6d5210e..34c4016 100644
27 --- a/drivers/scsi/qla2xxx/qla_attr.c
28 +++ b/drivers/scsi/qla2xxx/qla_attr.c
29 @@ -1284,6 +1284,9 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport)
30 struct Scsi_Host *host = rport_to_shost(rport);
31 fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
32
33 + if (!fcport)
34 + return;
35 +
36 qla2x00_abort_fcport_cmds(fcport);
37
38 /*
39 @@ -1301,6 +1304,9 @@ qla2x00_terminate_rport_io(struct fc_rport *rport)
40 {
41 fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
42
43 + if (!fcport)
44 + return;
45 +
46 /*
47 * At this point all fcport's software-states are cleared. Perform any
48 * final cleanup of firmware resources (PCBs and XCBs).
49 --
50 1.6.0
51