Skip to contentSkip to conversation

be2iscsi: memory leak on error path

PATCH In review Dan Carpenter 2 participants 2 messages Jun 10, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 be2iscsi: memory leak on error path

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

drivers/scsi/be2iscsi/be_main.c +1 -0
index dd5b105..779e1d1 100644
@@ -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].
Reviewed-by on v1 1/2
#1 lore raw
Quoted 9 lines · Dan Carpenter

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

drivers/scsi/be2iscsi/be_main.c +0 -0
index dd5b105..779e1d1 100644

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.