Skip to content

Commit b5fe5e9

Browse files
yizouJames Bottomley
authored andcommitted
[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 <[email protected]> Signed-off-by: Yi Zou <[email protected]> Signed-off-by: Robert Love <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent 3a91090 commit b5fe5e9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/scsi/libfc/fc_fcp.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,27 +1321,27 @@ static void fc_tm_done(struct fc_seq *seq, struct fc_frame *fp, void *arg)
13211321
*
13221322
* scsi-eh will escalate for when either happens.
13231323
*/
1324-
return;
1324+
goto out;
13251325
}
13261326

13271327
if (fc_fcp_lock_pkt(fsp))
1328-
return;
1328+
goto out;
13291329

13301330
/*
13311331
* raced with eh timeout handler.
13321332
*/
1333-
if (!fsp->seq_ptr || !fsp->wait_for_comp) {
1334-
spin_unlock_bh(&fsp->scsi_pkt_lock);
1335-
return;
1336-
}
1333+
if (!fsp->seq_ptr || !fsp->wait_for_comp)
1334+
goto out_unlock;
13371335

13381336
fh = fc_frame_header_get(fp);
13391337
if (fh->fh_type != FC_TYPE_BLS)
13401338
fc_fcp_resp(fsp, fp);
13411339
fsp->seq_ptr = NULL;
13421340
fsp->lp->tt.exch_done(seq);
1343-
fc_frame_free(fp);
1341+
out_unlock:
13441342
fc_fcp_unlock_pkt(fsp);
1343+
out:
1344+
fc_frame_free(fp);
13451345
}
13461346

13471347
/**

0 commit comments

Comments
 (0)