[SCSI] be2iscsi: fix memory leak on error path
authorDan Carpenter <error27@gmail.com>
Thu, 10 Jun 2010 07:52:21 +0000 (09:52 +0200)
committerJames Bottomley <James.Bottomley@suse.de>
Tue, 27 Jul 2010 17:01:41 +0000 (12:01 -0500)
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>
drivers/scsi/be2iscsi/be_main.c

index 8544145..353a90b 100644 (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].