be2iscsi: memory leak on error path
Subsystems (3)
PATCH 1/2 be2iscsi: memory leak on error path
I added a kfree(pwrb_arr) in front of the return.
Signed-off-by Dan Carpenter <[email protected]>
drivers/scsi/be2iscsi/be_main.c +1 -0
@@ -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].
Quoted 9 lines · Dan Carpenter
I added a
kfree(pwrb_arr)in front of the return.Signed-off-by Dan Carpenter<[email protected]>drivers/scsi/be2iscsi/be_main.c +0
-0
drivers/scsi/be2iscsi/be_main.c beiscsi_create_wrb_rings(struct beiscsi_hba *phba, · line 2756
Quoted 7 lines
drivers/scsi/be2iscsi/be_main.c +1
-0@@ -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].
Looks good. Thanks.
Reviewed-by Mike Christie <[email protected]>