[SCSI] libfc: fix fc_tm_done not freeing the allocated fsp pkt

Frame should be freed in fc_tm_done, this is an updated patch on the one
initially submitted by Hillf Danton.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
Yi Zou 2010-11-30 16:19:35 -08:00 committed by James Bottomley
parent 3a91090fe0
commit b5fe5e953c
1 changed files with 7 additions and 7 deletions

View File

@ -1321,27 +1321,27 @@ static void fc_tm_done(struct fc_seq *seq, struct fc_frame *fp, void *arg)
* *
* scsi-eh will escalate for when either happens. * scsi-eh will escalate for when either happens.
*/ */
return; goto out;
} }
if (fc_fcp_lock_pkt(fsp)) if (fc_fcp_lock_pkt(fsp))
return; goto out;
/* /*
* raced with eh timeout handler. * raced with eh timeout handler.
*/ */
if (!fsp->seq_ptr || !fsp->wait_for_comp) { if (!fsp->seq_ptr || !fsp->wait_for_comp)
spin_unlock_bh(&fsp->scsi_pkt_lock); goto out_unlock;
return;
}
fh = fc_frame_header_get(fp); fh = fc_frame_header_get(fp);
if (fh->fh_type != FC_TYPE_BLS) if (fh->fh_type != FC_TYPE_BLS)
fc_fcp_resp(fsp, fp); fc_fcp_resp(fsp, fp);
fsp->seq_ptr = NULL; fsp->seq_ptr = NULL;
fsp->lp->tt.exch_done(seq); fsp->lp->tt.exch_done(seq);
fc_frame_free(fp); out_unlock:
fc_fcp_unlock_pkt(fsp); fc_fcp_unlock_pkt(fsp);
out:
fc_frame_free(fp);
} }
/** /**