Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a716a85 authored by Yi Zou's avatar Yi Zou Committed by James Bottomley
Browse files

[SCSI] libfc: release DDP context if frame_send() fails



In case frame_send() fails, make sure to let the underlying HW release the DDP
context that has already been set up before calling frame_send().

Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <jbottomley@parallels.com>
parent 83383dd1
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1978,6 +1978,7 @@ static struct fc_seq *fc_exch_seq_send(struct fc_lport *lport,
	spin_unlock_bh(&ep->ex_lock);
	spin_unlock_bh(&ep->ex_lock);
	return sp;
	return sp;
err:
err:
	fc_fcp_ddp_done(fr_fsp(fp));
	rc = fc_exch_done_locked(ep);
	rc = fc_exch_done_locked(ep);
	spin_unlock_bh(&ep->ex_lock);
	spin_unlock_bh(&ep->ex_lock);
	if (!rc)
	if (!rc)
+1 −1
Original line number Original line Diff line number Diff line
@@ -312,7 +312,7 @@ void fc_fcp_ddp_setup(struct fc_fcp_pkt *fsp, u16 xid)
 *		       DDP related resources for a fcp_pkt
 *		       DDP related resources for a fcp_pkt
 * @fsp: The FCP packet that DDP had been used on
 * @fsp: The FCP packet that DDP had been used on
 */
 */
static void fc_fcp_ddp_done(struct fc_fcp_pkt *fsp)
void fc_fcp_ddp_done(struct fc_fcp_pkt *fsp)
{
{
	struct fc_lport *lport;
	struct fc_lport *lport;


+1 −0
Original line number Original line Diff line number Diff line
@@ -108,6 +108,7 @@ extern struct fc4_prov fc_rport_fcp_init; /* FCP initiator provider */
 * Set up direct-data placement for this I/O request
 * Set up direct-data placement for this I/O request
 */
 */
void fc_fcp_ddp_setup(struct fc_fcp_pkt *fsp, u16 xid);
void fc_fcp_ddp_setup(struct fc_fcp_pkt *fsp, u16 xid);
void fc_fcp_ddp_done(struct fc_fcp_pkt *fsp);


/*
/*
 * Module setup functions
 * Module setup functions