]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/scsi/libfc/fc_elsct.c
[SCSI] libfc: fix memory corruption caused by double frees and bad error handling
[mirror_ubuntu-zesty-kernel.git] / drivers / scsi / libfc / fc_elsct.c
index 5cfa68732e9d7dd8a0da7aaa9e8aad1c4aa7e2a1..92984587ff4df03b98fa4e90aee1b23fafddeabd 100644 (file)
@@ -53,8 +53,10 @@ static struct fc_seq *fc_elsct_send(struct fc_lport *lport,
                did = FC_FID_DIR_SERV;
        }
 
-       if (rc)
+       if (rc) {
+               fc_frame_free(fp);
                return NULL;
+       }
 
        fc_fill_fc_hdr(fp, r_ctl, did, fc_host_port_id(lport->host), fh_type,
                       FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0);