Date: Sun, 8 Nov 2015 18:48:35 +0000 (UTC) From: Svatopluk Kraus <skra@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290553 - head/sys/contrib/vchiq/interface/vchiq_arm Message-ID: <201511081848.tA8ImZan061624@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: skra Date: Sun Nov 8 18:48:35 2015 New Revision: 290553 URL: https://svnweb.freebsd.org/changeset/base/290553 Log: Fix pagelist bus_dmamap_t map handling. Memory for pagelist is allocated by bus_dmamem_alloc() which creates associated bus_dmamap_t map for us. When this memory is freed by bus_dmamem_free(), the map is freed as well. Thus there is no need to free it explicitly by bus_dmamap_destroy(), which leads to double freeing. Discussed with: gonzo Approved by: kib (mentor) Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Sun Nov 8 18:11:24 2015 (r290552) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Sun Nov 8 18:48:35 2015 (r290553) @@ -542,9 +542,8 @@ create_pagelist(char __user *buf, size_t return 0; failed_load: - bus_dmamap_unload(bi->pagelist_dma_tag, bi->pagelist_dma_map); + bus_dmamem_free(bi->pagelist_dma_tag, bi->pagelist, bi->pagelist_dma_map); failed_alloc: - bus_dmamap_destroy(bi->pagelist_dma_tag, bi->pagelist_dma_map); bus_dma_tag_destroy(bi->pagelist_dma_tag); return err; @@ -613,7 +612,6 @@ free_pagelist(BULKINFO_T *bi, int actual bus_dmamap_unload(bi->pagelist_dma_tag, bi->pagelist_dma_map); bus_dmamem_free(bi->pagelist_dma_tag, bi->pagelist, bi->pagelist_dma_map); - bus_dmamap_destroy(bi->pagelist_dma_tag, bi->pagelist_dma_map); bus_dma_tag_destroy(bi->pagelist_dma_tag); free(bi, M_VCPAGELIST);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511081848.tA8ImZan061624>