瀏覽代碼

[SCSI] be2iscsi: fix memory leak on error path

I added a kfree(pwrb_arr) in front of the return.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Dan Carpenter 15 年之前
父節點
當前提交
1462b8ffd9
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/scsi/be2iscsi/be_main.c

+ 1 - 0
drivers/scsi/be2iscsi/be_main.c

@@ -2750,6 +2750,7 @@ beiscsi_create_wrb_rings(struct beiscsi_hba *phba,
 		if (status != 0) {
 			shost_printk(KERN_ERR, phba->shost,
 				     "wrbq create failed.");
+			kfree(pwrb_arr);
 			return status;
 		}
 		phwi_ctrlr->wrb_context[i * 2].cid = phwi_context->be_wrbq[i].