From 1462b8ffd9a9e4798d4e0f9eaadbd1ac0373a11b Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 10 Jun 2010 09:52:21 +0200 Subject: [PATCH] [SCSI] be2iscsi: fix memory leak on error path I added a kfree(pwrb_arr) in front of the return. Signed-off-by: Dan Carpenter Reviewed-by: Mike Christie Signed-off-by: James Bottomley --- drivers/scsi/be2iscsi/be_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 854414551bb..353a90b3574 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/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]. -- 2.11.4.GIT