提交 1462b8ff 编写于 作者: D Dan Carpenter 提交者: James Bottomley

[SCSI] be2iscsi: fix memory leak on error path

I added a kfree(pwrb_arr) in front of the return.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Reviewed-by: NMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 c5f10187
...@@ -2750,6 +2750,7 @@ beiscsi_create_wrb_rings(struct beiscsi_hba *phba, ...@@ -2750,6 +2750,7 @@ beiscsi_create_wrb_rings(struct beiscsi_hba *phba,
if (status != 0) { if (status != 0) {
shost_printk(KERN_ERR, phba->shost, shost_printk(KERN_ERR, phba->shost,
"wrbq create failed."); "wrbq create failed.");
kfree(pwrb_arr);
return status; return status;
} }
phwi_ctrlr->wrb_context[i * 2].cid = phwi_context->be_wrbq[i]. phwi_ctrlr->wrb_context[i * 2].cid = phwi_context->be_wrbq[i].
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册