From 72e0daad555bc0ca2e7abd68593087d098d866a8 Mon Sep 17 00:00:00 2001 From: Hillf Danton Date: Tue, 30 Nov 2010 16:18:59 -0800 Subject: [PATCH] [SCSI] libfc: fix memory leakage in local port There seems info should get freed when error encountered. Signed-off-by: Hillf Danton Signed-off-by: Robert Love Signed-off-by: James Bottomley --- drivers/scsi/libfc/fc_lport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index 9c1d6b8b24a3..b91a11e4fa06 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c @@ -1703,8 +1703,10 @@ static int fc_lport_els_request(struct fc_bsg_job *job, info->sg = job->reply_payload.sg_list; if (!lport->tt.exch_seq_send(lport, fp, fc_lport_bsg_resp, - NULL, info, tov)) + NULL, info, tov)) { + kfree(info); return -ECOMM; + } return 0; } -- 2.39.2