]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[SCSI] be2iscsi: Fix double free of MCCQ info memory.
authorJayamohan Kallickal <jayamohan.kallickal@emulex.com>
Wed, 4 Apr 2012 04:41:42 +0000 (23:41 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 25 Apr 2012 08:09:22 +0000 (09:09 +0100)
In case of MCC_Q creation failed, the MCCQ info memory is freed
from be_mcc_queues_destroy and be_mcc_queues_create. This caused
kernel to panic because of double free.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/be2iscsi/be_main.c

index f69c56bd9b235088d1b82625e73fba2b71374b36..64100247c6243d862d945af00e65fb9c52ac8607 100644 (file)
@@ -2908,9 +2908,11 @@ beiscsi_post_pages(struct beiscsi_hba *phba)
 static void be_queue_free(struct beiscsi_hba *phba, struct be_queue_info *q)
 {
        struct be_dma_mem *mem = &q->dma_mem;
-       if (mem->va)
+       if (mem->va) {
                pci_free_consistent(phba->pcidev, mem->size,
                        mem->va, mem->dma);
+               mem->va = NULL;
+       }
 }
 
 static int be_queue_alloc(struct beiscsi_hba *phba, struct be_queue_info *q,