Commit 135ea137 authored by Martin Petermann's avatar Martin Petermann Committed by James Bottomley

[SCSI] zfcp: Avoid referencing freed memory in req send

Avoid referencing a fsf request after sending it in fcp_fsf_req_send,
it might have already completed and deallocated.
Signed-off-by: default avatarMartin Petermann <martin@linux.vnet.ibm.com>
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent b4efdd58
...@@ -766,8 +766,9 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_adapter *adapter, ...@@ -766,8 +766,9 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_adapter *adapter,
static int zfcp_fsf_req_send(struct zfcp_fsf_req *req) static int zfcp_fsf_req_send(struct zfcp_fsf_req *req)
{ {
struct zfcp_adapter *adapter = req->adapter; struct zfcp_adapter *adapter = req->adapter;
unsigned long flags; unsigned long flags;
int idx; int idx;
int with_qtcb = (req->qtcb != NULL);
/* put allocated FSF request into hash table */ /* put allocated FSF request into hash table */
spin_lock_irqsave(&adapter->req_list_lock, flags); spin_lock_irqsave(&adapter->req_list_lock, flags);
...@@ -789,7 +790,7 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *req) ...@@ -789,7 +790,7 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *req)
} }
/* Don't increase for unsolicited status */ /* Don't increase for unsolicited status */
if (req->qtcb) if (with_qtcb)
adapter->fsf_req_seq_no++; adapter->fsf_req_seq_no++;
adapter->req_no++; adapter->req_no++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment