diff options
author | Chad Dupuis <chad.dupuis@cavium.com> | 2017-06-26 18:59:33 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-06-28 04:39:09 +0300 |
commit | de08f46b90d3b353f53d273604e6544186564e59 (patch) | |
tree | 274791201df7c1b323e55b71d87a220e8210d92e /drivers/scsi | |
parent | 56ffd3a0500e3b0c133da451036074fd0a8c3f1c (diff) | |
download | linux-de08f46b90d3b353f53d273604e6544186564e59.tar.xz |
scsi: bnx2fc: Check for connection offload before sending RRQ.
If the connection is not offloaded then the backpointers from the tgt
pointer are undefined.
Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_els.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_els.c b/drivers/scsi/bnx2fc/bnx2fc_els.c index 68ca518d34b0..fee12c3d67cd 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_els.c +++ b/drivers/scsi/bnx2fc/bnx2fc_els.c @@ -61,13 +61,20 @@ int bnx2fc_send_rrq(struct bnx2fc_cmd *aborted_io_req) struct fc_els_rrq rrq; struct bnx2fc_rport *tgt = aborted_io_req->tgt; - struct fc_lport *lport = tgt->rdata->local_port; + struct fc_lport *lport = NULL; struct bnx2fc_els_cb_arg *cb_arg = NULL; - u32 sid = tgt->sid; - u32 r_a_tov = lport->r_a_tov; + u32 sid = 0; + u32 r_a_tov = 0; unsigned long start = jiffies; int rc; + if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) + return -EINVAL; + + lport = tgt->rdata->local_port; + sid = tgt->sid; + r_a_tov = lport->r_a_tov; + BNX2FC_ELS_DBG("Sending RRQ orig_xid = 0x%x\n", aborted_io_req->xid); memset(&rrq, 0, sizeof(rrq)); |