[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>
This commit is contained in:
Dan Carpenter 2010-06-10 09:52:21 +02:00 committed by James Bottomley
parent c5f1018796
commit 1462b8ffd9
1 changed files with 1 additions and 0 deletions

View File

@ -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].