From: Hillf Danton Date: Wed, 1 Dec 2010 00:18:54 +0000 (-0800) Subject: [SCSI] libfc: fix memory leakage in local port X-Git-Tag: firefly_0821_release~7613^2~2673^2~80 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2d6dfb005e24d7e3404f4c0d333a94b050059173;p=firefly-linux-kernel-4.4.55.git [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 --- diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index 9be63edbf8fb..9c1d6b8b24a3 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c @@ -1762,8 +1762,10 @@ static int fc_lport_ct_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; }