]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
be2iscsi:Fix double free of MCCQ info memory.
authorroot <root@localhost.localdomain>
Wed, 2 May 2012 14:14:51 +0000 (19:44 +0530)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Fri, 11 May 2012 00:08:51 +0000 (17:08 -0700)
 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: root <root@localhost.(none)>
drivers/scsi/be2iscsi/be_main.c

index 47a9e871feb6834ea9f27971f1f798b7fa7d7e1e..9414dc741f26c9ac84f03841d04f3c0f469d4aca 100644 (file)
@@ -2907,9 +2907,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,