diff options
| author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2024-07-23 19:21:17 +0000 |
|---|---|---|
| committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2024-07-26 10:45:01 +0000 |
| commit | d1bdc2821fcd416ab9b238580386eb605a6128d0 (patch) | |
| tree | 3d0be79e25a87ae24b1e36700d06dfd86009ebbb /sys/dev | |
| parent | 5b8c01d13a0970b11f47503fcd627d249a6e638a (diff) | |
Diffstat (limited to 'sys/dev')
27 files changed, 72 insertions, 103 deletions
diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c index b710a542a10f..b63c0aaf634a 100644 --- a/sys/dev/agp/agp_i810.c +++ b/sys/dev/agp/agp_i810.c @@ -1796,7 +1796,7 @@ agp_i810_free_memory(device_t dev, struct agp_memory *mem) vm_page_unwire(m, PQ_INACTIVE); VM_OBJECT_WUNLOCK(mem->am_obj); } else { - contigfree(sc->argb_cursor, mem->am_size, M_AGP); + free(sc->argb_cursor, M_AGP); sc->argb_cursor = NULL; } } diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index 742ed63a92aa..0f44c3c94672 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -2987,11 +2987,7 @@ bwn_dma_ringsetup(struct bwn_mac *mac, int controller_index, return (dr); fail2: - if (dr->dr_txhdr_cache != NULL) { - contigfree(dr->dr_txhdr_cache, - (dr->dr_numslots / BWN_TX_SLOTS_PER_FRAME) * - BWN_MAXTXHDRSIZE, M_DEVBUF); - } + free(dr->dr_txhdr_cache, M_DEVBUF); fail1: free(dr->dr_meta, M_DEVBUF); fail0: @@ -3009,11 +3005,7 @@ bwn_dma_ringfree(struct bwn_dma_ring **dr) bwn_dma_free_descbufs(*dr); bwn_dma_free_ringmemory(*dr); - if ((*dr)->dr_txhdr_cache != NULL) { - contigfree((*dr)->dr_txhdr_cache, - ((*dr)->dr_numslots / BWN_TX_SLOTS_PER_FRAME) * - BWN_MAXTXHDRSIZE, M_DEVBUF); - } + free((*dr)->dr_txhdr_cache, M_DEVBUF); free((*dr)->dr_meta, M_DEVBUF); free(*dr, M_DEVBUF); diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index a08ddea00d05..529fc2a5b825 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -181,7 +181,7 @@ static void free_ddp_rcv_buffer(struct toepcb *toep, struct ddp_rcv_buffer *drb) { t4_free_page_pods(&drb->prsv); - contigfree(drb->buf, drb->len, M_CXGBE); + free(drb->buf, M_CXGBE); free(drb, M_CXGBE); counter_u64_add(toep->ofld_rxq->ddp_buffer_free, 1); free_toepcb(toep); @@ -242,7 +242,7 @@ alloc_ddp_rcv_buffer(struct toepcb *toep, int how) error = t4_alloc_page_pods_for_rcvbuf(&td->pr, drb); if (error != 0) { - contigfree(drb->buf, drb->len, M_CXGBE); + free(drb->buf, M_CXGBE); free(drb, M_CXGBE); return (NULL); } @@ -250,7 +250,7 @@ alloc_ddp_rcv_buffer(struct toepcb *toep, int how) error = t4_write_page_pods_for_rcvbuf(sc, toep->ctrlq, toep->tid, drb); if (error != 0) { t4_free_page_pods(&drb->prsv); - contigfree(drb->buf, drb->len, M_CXGBE); + free(drb->buf, M_CXGBE); free(drb, M_CXGBE); return (NULL); } diff --git a/sys/dev/dcons/dcons_os.c b/sys/dev/dcons/dcons_os.c index 0d96ab51659b..4e34659fb3e8 100644 --- a/sys/dev/dcons/dcons_os.c +++ b/sys/dev/dcons/dcons_os.c @@ -442,7 +442,7 @@ dcons_modevent(module_t mode, int type, void *data) dcons_detach(DCONS_GDB); dg.buf->magic = 0; - contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF); + free(dg.buf, M_DEVBUF); } /* Wait for tty deferred free callbacks to complete. */ diff --git a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c index 32d3e465c569..225c91b44f21 100644 --- a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c +++ b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c @@ -146,9 +146,9 @@ static __inline void *__get_free_pages(int order) M_DEVBUF, M_WAITOK, BUS_SPACE_MAXADDR_24BIT, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); } -static __inline void free_pages(void *p, int order) +static __inline void free_pages(void *p) { - contigfree(p, PAGE_SIZE<<order, M_DEVBUF); + free(p, M_DEVBUF); } static int hpt_alloc_mem(PVBUS_EXT vbus_ext) @@ -230,7 +230,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) for (i=0; i<os_max_cache_pages; i++) { p = dmapool_get_page((PVBUS)vbus_ext->vbus, &bus); HPT_ASSERT(p); - free_pages(p, 0); + free_pages(p); } for (f=vbus_ext->freelist_dma_head; f; f=f->next) { @@ -244,7 +244,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) while ((p=freelist_get_dma(f, &bus))) { if (order) - free_pages(p, order); + free_pages(p); else { /* can't free immediately since other blocks in this page may still be in the list */ if (((HPT_UPTR)p & (PAGE_SIZE-1))==0) @@ -254,7 +254,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) } while ((p = dmapool_get_page((PVBUS)vbus_ext->vbus, &bus))) - free_pages(p, 0); + free_pages(p); } static int hpt_init_vbus(PVBUS_EXT vbus_ext) diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c index 4a014ce17f4e..5c4718bf582f 100644 --- a/sys/dev/hptmv/entry.c +++ b/sys/dev/hptmv/entry.c @@ -914,7 +914,7 @@ hptmv_allocate_edma_queues(IAL_ADAPTER_T *pAdapter) { MV_ERROR("RR18xx[%d]: Error in Request Quueues Alignment\n", pAdapter->mvSataAdapter.adapterId); - contigfree(pAdapter->requestsArrayBaseAddr, REQUESTS_ARRAY_SIZE, M_DEVBUF); + free(pAdapter->requestsArrayBaseAddr, M_DEVBUF); return -1; } /* response queues */ @@ -924,7 +924,7 @@ hptmv_allocate_edma_queues(IAL_ADAPTER_T *pAdapter) { MV_ERROR("RR18xx[%d]: Failed to allocate memory for EDMA response" " queues\n", pAdapter->mvSataAdapter.adapterId); - contigfree(pAdapter->requestsArrayBaseAddr, RESPONSES_ARRAY_SIZE, M_DEVBUF); + free(pAdapter->requestsArrayBaseAddr, M_DEVBUF); return -1; } pAdapter->responsesArrayBaseDmaAddr = fOsPhysicalAddress(pAdapter->responsesArrayBaseAddr); @@ -941,8 +941,8 @@ hptmv_allocate_edma_queues(IAL_ADAPTER_T *pAdapter) { MV_ERROR("RR18xx[%d]: Error in Response Queues Alignment\n", pAdapter->mvSataAdapter.adapterId); - contigfree(pAdapter->requestsArrayBaseAddr, REQUESTS_ARRAY_SIZE, M_DEVBUF); - contigfree(pAdapter->responsesArrayBaseAddr, RESPONSES_ARRAY_SIZE, M_DEVBUF); + free(pAdapter->requestsArrayBaseAddr, M_DEVBUF); + free(pAdapter->responsesArrayBaseAddr, M_DEVBUF); return -1; } return 0; @@ -951,8 +951,8 @@ hptmv_allocate_edma_queues(IAL_ADAPTER_T *pAdapter) static void hptmv_free_edma_queues(IAL_ADAPTER_T *pAdapter) { - contigfree(pAdapter->requestsArrayBaseAddr, REQUESTS_ARRAY_SIZE, M_DEVBUF); - contigfree(pAdapter->responsesArrayBaseAddr, RESPONSES_ARRAY_SIZE, M_DEVBUF); + free(pAdapter->requestsArrayBaseAddr, M_DEVBUF); + free(pAdapter->responsesArrayBaseAddr, M_DEVBUF); } static PVOID @@ -2950,13 +2950,13 @@ void void os_free_page(_VBUS_ARG void *p) { - contigfree(p, 0x1000, M_DEVBUF); + free(p, M_DEVBUF); } void os_free_dma_page(_VBUS_ARG void *p) { - contigfree(p, 0x1000, M_DEVBUF); + free(p, M_DEVBUF); } void diff --git a/sys/dev/hptnr/hptnr_osm_bsd.c b/sys/dev/hptnr/hptnr_osm_bsd.c index 00774bf9be4a..a8ac77c5ad5a 100644 --- a/sys/dev/hptnr/hptnr_osm_bsd.c +++ b/sys/dev/hptnr/hptnr_osm_bsd.c @@ -143,9 +143,9 @@ static __inline void *__get_free_pages(int order) M_DEVBUF, M_WAITOK, BUS_SPACE_MAXADDR_24BIT, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); } -static __inline void free_pages(void *p, int order) +static __inline void free_pages(void *p) { - contigfree(p, PAGE_SIZE<<order, M_DEVBUF); + free(p, M_DEVBUF); } static int hpt_alloc_mem(PVBUS_EXT vbus_ext) @@ -227,7 +227,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) for (i=0; i<os_max_cache_pages; i++) { p = dmapool_get_page((PVBUS)vbus_ext->vbus, &bus); HPT_ASSERT(p); - free_pages(p, 0); + free_pages(p); } for (f=vbus_ext->freelist_dma_head; f; f=f->next) { @@ -241,7 +241,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) while ((p=freelist_get_dma(f, &bus))) { if (order) - free_pages(p, order); + free_pages(p); else { /* can't free immediately since other blocks in this page may still be in the list */ if (((HPT_UPTR)p & (PAGE_SIZE-1))==0) @@ -251,7 +251,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) } while ((p = dmapool_get_page((PVBUS)vbus_ext->vbus, &bus))) - free_pages(p, 0); + free_pages(p); } static int hpt_init_vbus(PVBUS_EXT vbus_ext) diff --git a/sys/dev/hptrr/hptrr_osm_bsd.c b/sys/dev/hptrr/hptrr_osm_bsd.c index 4208dd620e37..68e9af3aff02 100644 --- a/sys/dev/hptrr/hptrr_osm_bsd.c +++ b/sys/dev/hptrr/hptrr_osm_bsd.c @@ -144,9 +144,9 @@ static __inline void *__get_free_pages(int order) M_DEVBUF, M_WAITOK, BUS_SPACE_MAXADDR_24BIT, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); } -static __inline void free_pages(void *p, int order) +static __inline void free_pages(void *p) { - contigfree(p, PAGE_SIZE<<order, M_DEVBUF); + free(p, M_DEVBUF); } static int hpt_alloc_mem(PVBUS_EXT vbus_ext) @@ -228,7 +228,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) for (i=0; i<os_max_cache_pages; i++) { p = dmapool_get_page((PVBUS)vbus_ext->vbus, &bus); HPT_ASSERT(p); - free_pages(p, 0); + free_pages(p); } for (f=vbus_ext->freelist_dma_head; f; f=f->next) { @@ -242,7 +242,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) while ((p=freelist_get_dma(f, &bus))) { if (order) - free_pages(p, order); + free_pages(p); else { /* can't free immediately since other blocks in this page may still be in the list */ if (((HPT_UPTR)p & (PAGE_SIZE-1))==0) @@ -252,7 +252,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) } while ((p = dmapool_get_page((PVBUS)vbus_ext->vbus, &bus))) - free_pages(p, 0); + free_pages(p); } static int hpt_init_vbus(PVBUS_EXT vbus_ext) diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index 9f51f5b32199..5bdd804b06d5 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -5131,7 +5131,7 @@ hn_destroy_rx_data(struct hn_softc *sc) if (sc->hn_rxbuf != NULL) { if ((sc->hn_flags & HN_FLAG_RXBUF_REF) == 0) - contigfree(sc->hn_rxbuf, HN_RXBUF_SIZE, M_DEVBUF); + free(sc->hn_rxbuf, M_DEVBUF); else device_printf(sc->hn_dev, "RXBUF is referenced\n"); sc->hn_rxbuf = NULL; @@ -5146,8 +5146,7 @@ hn_destroy_rx_data(struct hn_softc *sc) if (rxr->hn_br == NULL) continue; if ((rxr->hn_rx_flags & HN_RX_FLAG_BR_REF) == 0) { - contigfree(rxr->hn_br, HN_TXBR_SIZE + HN_RXBR_SIZE, - M_DEVBUF); + free(rxr->hn_br, M_DEVBUF); } else { device_printf(sc->hn_dev, "%dth channel bufring is referenced", i); @@ -5649,7 +5648,7 @@ hn_destroy_tx_data(struct hn_softc *sc) if (sc->hn_chim != NULL) { if ((sc->hn_flags & HN_FLAG_CHIM_REF) == 0) { - contigfree(sc->hn_chim, HN_CHIM_SIZE, M_DEVBUF); + free(sc->hn_chim, M_DEVBUF); } else { device_printf(sc->hn_dev, "chimney sending buffer is referenced"); diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c index 774ba6da46e7..5d0b23a09213 100644 --- a/sys/dev/hyperv/vmbus/vmbus.c +++ b/sys/dev/hyperv/vmbus/vmbus.c @@ -900,29 +900,27 @@ vmbus_dma_free(struct vmbus_softc *sc) int cpu; if (sc->vmbus_evtflags != NULL) { - contigfree(sc->vmbus_evtflags, PAGE_SIZE, M_DEVBUF); + free(sc->vmbus_evtflags, M_DEVBUF); sc->vmbus_evtflags = NULL; sc->vmbus_rx_evtflags = NULL; sc->vmbus_tx_evtflags = NULL; } if (sc->vmbus_mnf1 != NULL) { - contigfree(sc->vmbus_mnf1, PAGE_SIZE, M_DEVBUF); + free(sc->vmbus_mnf1, M_DEVBUF); sc->vmbus_mnf1 = NULL; } if (sc->vmbus_mnf2 != NULL) { - contigfree(sc->vmbus_mnf2, sizeof(struct vmbus_mnf), M_DEVBUF); + free(sc->vmbus_mnf2, M_DEVBUF); sc->vmbus_mnf2 = NULL; } CPU_FOREACH(cpu) { if (VMBUS_PCPU_GET(sc, message, cpu) != NULL) { - contigfree(VMBUS_PCPU_GET(sc, message, cpu), PAGE_SIZE, - M_DEVBUF); + free(VMBUS_PCPU_GET(sc, message, cpu), M_DEVBUF); VMBUS_PCPU_GET(sc, message, cpu) = NULL; } if (VMBUS_PCPU_GET(sc, event_flags, cpu) != NULL) { - contigfree(VMBUS_PCPU_GET(sc, event_flags, cpu), - PAGE_SIZE, M_DEVBUF); + free(VMBUS_PCPU_GET(sc, event_flags, cpu), M_DEVBUF); VMBUS_PCPU_GET(sc, event_flags, cpu) = NULL; } } @@ -1424,7 +1422,7 @@ vmbus_free_cpu_mem(struct vmbus_softc *sc) void **hv_cpu_mem; hv_cpu_mem = VMBUS_PCPU_PTR(sc, cpu_mem, cpu); if(*hv_cpu_mem != NULL) { - contigfree(*hv_cpu_mem, PAGE_SIZE, M_DEVBUF); + free(*hv_cpu_mem, M_DEVBUF); *hv_cpu_mem = NULL; } } diff --git a/sys/dev/hyperv/vmbus/vmbus_chan.c b/sys/dev/hyperv/vmbus/vmbus_chan.c index 0922470d4672..5ce6e545158c 100644 --- a/sys/dev/hyperv/vmbus/vmbus_chan.c +++ b/sys/dev/hyperv/vmbus/vmbus_chan.c @@ -341,8 +341,7 @@ vmbus_chan_open(struct vmbus_channel *chan, int txbr_size, int rxbr_size, * Allocate the TX+RX bufrings. */ KASSERT(chan->ch_bufring == NULL, ("bufrings are allocated")); - chan->ch_bufring_size = txbr_size + rxbr_size; - chan->ch_bufring = contigmalloc(chan->ch_bufring_size, M_DEVBUF, + chan->ch_bufring = contigmalloc(txbr_size + rxbr_size, M_DEVBUF, M_WAITOK | M_ZERO, 0ul, ~0ul, PAGE_SIZE, 0); if (chan->ch_bufring == NULL) { vmbus_chan_printf(chan, "bufring allocation failed\n"); @@ -368,8 +367,7 @@ vmbus_chan_open(struct vmbus_channel *chan, int txbr_size, int rxbr_size, "leak %d bytes memory\n", chan->ch_id, txbr_size + rxbr_size); } else { - contigfree(chan->ch_bufring, chan->ch_bufring_size, - M_DEVBUF); + free(chan->ch_bufring, M_DEVBUF); } chan->ch_bufring = NULL; } @@ -939,7 +937,7 @@ disconnect: * Destroy the TX+RX bufrings. */ if (chan->ch_bufring != NULL) { - contigfree(chan->ch_bufring, chan->ch_bufring_size, M_DEVBUF); + free(chan->ch_bufring, M_DEVBUF); chan->ch_bufring = NULL; } return (error); @@ -1679,7 +1677,7 @@ vmbus_chan_free(struct vmbus_channel *chan) KASSERT(chan->ch_poll_intvl == 0, ("chan%u: polling is activated", chan->ch_id)); - contigfree(chan->ch_monprm, sizeof(struct hyperv_mon_param), M_DEVBUF); + free(chan->ch_monprm, M_DEVBUF); mtx_destroy(&chan->ch_subchan_lock); sx_destroy(&chan->ch_orphan_lock); vmbus_rxbr_deinit(&chan->ch_rxbr); diff --git a/sys/dev/hyperv/vmbus/vmbus_chanvar.h b/sys/dev/hyperv/vmbus/vmbus_chanvar.h index e88ada2dd274..c02ec24c70a1 100644 --- a/sys/dev/hyperv/vmbus/vmbus_chanvar.h +++ b/sys/dev/hyperv/vmbus/vmbus_chanvar.h @@ -123,7 +123,6 @@ struct vmbus_channel { struct vmbus_channel *ch_prichan; /* owner primary chan */ void *ch_bufring; /* TX+RX bufrings */ - size_t ch_bufring_size; uint32_t ch_bufring_gpadl; struct task ch_attach_task; /* run in ch_mgmt_tq */ diff --git a/sys/dev/hyperv/vmbus/vmbus_xact.c b/sys/dev/hyperv/vmbus/vmbus_xact.c index f5f766f2c2fc..eb221ef92b2c 100644 --- a/sys/dev/hyperv/vmbus/vmbus_xact.c +++ b/sys/dev/hyperv/vmbus/vmbus_xact.c @@ -104,7 +104,7 @@ static void vmbus_xact_free(struct vmbus_xact *xact) { - contigfree(xact->x_req, xact->x_ctx->xc_req_size, M_DEVBUF); + free(xact->x_req, M_DEVBUF); free(xact->x_resp0, M_DEVBUF); if (xact->x_priv != NULL) free(xact->x_priv, M_DEVBUF); diff --git a/sys/dev/ioat/ioat_test.c b/sys/dev/ioat/ioat_test.c index 9c081e0fb0b9..6ff3494a76da 100644 --- a/sys/dev/ioat/ioat_test.c +++ b/sys/dev/ioat/ioat_test.c @@ -82,17 +82,11 @@ static void _ioat_test_log(int verbosity, const char *fmt, ...); static void ioat_test_transaction_destroy(struct test_transaction *tx) { - struct ioat_test *test; int i; - test = tx->test; - for (i = 0; i < IOAT_MAX_BUFS; i++) { if (tx->buf[i] != NULL) { - if (test->testkind == IOAT_TEST_DMA_8K) - free(tx->buf[i], M_IOAT_TEST); - else - contigfree(tx->buf[i], tx->length, M_IOAT_TEST); + free(tx->buf[i], M_IOAT_TEST); tx->buf[i] = NULL; } } diff --git a/sys/dev/isci/isci.c b/sys/dev/isci/isci.c index 2b5d4301f6b2..1dede4e45b4c 100644 --- a/sys/dev/isci/isci.c +++ b/sys/dev/isci/isci.c @@ -235,7 +235,7 @@ isci_detach(device_t device) sci_pool_get(controller->unmap_buffer_pool, unmap_buffer); if (unmap_buffer == NULL) break; - contigfree(unmap_buffer, PAGE_SIZE, M_ISCI); + free(unmap_buffer, M_ISCI); } } diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index dfcaa01d366b..7542b17e19eb 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -555,8 +555,7 @@ lge_attach(device_t dev) fail: lge_free_jumbo_mem(sc); if (sc->lge_ldata) - contigfree(sc->lge_ldata, - sizeof(struct lge_list_data), M_DEVBUF); + free(sc->lge_ldata, M_DEVBUF); if (ifp) if_free(ifp); if (sc->lge_irq) @@ -590,7 +589,7 @@ lge_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->lge_irq); bus_release_resource(dev, LGE_RES, LGE_RID, sc->lge_res); - contigfree(sc->lge_ldata, sizeof(struct lge_list_data), M_DEVBUF); + free(sc->lge_ldata, M_DEVBUF); if_free(ifp); lge_free_jumbo_mem(sc); mtx_destroy(&sc->lge_mtx); @@ -784,7 +783,7 @@ lge_free_jumbo_mem(struct lge_softc *sc) free(entry, M_DEVBUF); } - contigfree(sc->lge_cdata.lge_jumbo_buf, LGE_JMEM, M_DEVBUF); + free(sc->lge_cdata.lge_jumbo_buf, M_DEVBUF); return; } diff --git a/sys/dev/netmap/if_ptnet.c b/sys/dev/netmap/if_ptnet.c index cea62517b2e6..bf14bfdb73ea 100644 --- a/sys/dev/netmap/if_ptnet.c +++ b/sys/dev/netmap/if_ptnet.c @@ -540,7 +540,7 @@ ptnet_detach(device_t dev) ptnet_irqs_fini(sc); if (sc->csb_gh) { - contigfree(sc->csb_gh, 2*PAGE_SIZE, M_DEVBUF); + free(sc->csb_gh, M_DEVBUF); sc->csb_gh = NULL; sc->csb_hg = NULL; } diff --git a/sys/dev/netmap/netmap_mem2.c b/sys/dev/netmap/netmap_mem2.c index 23954b377f9b..473b252e7329 100644 --- a/sys/dev/netmap/netmap_mem2.c +++ b/sys/dev/netmap/netmap_mem2.c @@ -1284,7 +1284,7 @@ netmap_reset_obj_allocator(struct netmap_obj_pool *p) * in the lut. */ for (i = 0; i < p->objtotal; i += p->_clustentries) { - contigfree(p->lut[i].vaddr, p->_clustsize, M_NETMAP); + free(p->lut[i].vaddr, M_NETMAP); } nm_free_lut(p->lut, p->objtotal); } @@ -1402,7 +1402,6 @@ static int netmap_finalize_obj_allocator(struct netmap_obj_pool *p) { int i; /* must be signed */ - size_t n; if (p->lut) { /* if the lut is already there we assume that also all the @@ -1430,7 +1429,6 @@ netmap_finalize_obj_allocator(struct netmap_obj_pool *p) * Allocate clusters, init pointers */ - n = p->_clustsize; for (i = 0; i < (int)p->objtotal;) { int lim = i + p->_clustentries; char *clust; @@ -1442,7 +1440,7 @@ netmap_finalize_obj_allocator(struct netmap_obj_pool *p) * can live with standard malloc, because the hardware will not * access the pages directly. */ - clust = contigmalloc(n, M_NETMAP, M_NOWAIT | M_ZERO, + clust = contigmalloc(p->_clustsize, M_NETMAP, M_NOWAIT | M_ZERO, (size_t)0, -1UL, PAGE_SIZE, 0); if (clust == NULL) { /* @@ -1456,8 +1454,7 @@ netmap_finalize_obj_allocator(struct netmap_obj_pool *p) lim = i / 2; for (i--; i >= lim; i--) { if (i % p->_clustentries == 0 && p->lut[i].vaddr) - contigfree(p->lut[i].vaddr, - n, M_NETMAP); + free(p->lut[i].vaddr, M_NETMAP); p->lut[i].vaddr = NULL; } out: diff --git a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c index c24d03a178ee..c8c9eb8c8dd8 100644 --- a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c +++ b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c @@ -6478,7 +6478,6 @@ int agtiapi_ReleaseHBA( device_t dev ) pCard->pPortalData = NULL; AGTIAPI_PRINTK("agtiapi_ReleaseHBA: PortalData released\n"); } - //calls contigfree() or free() agtiapi_MemFree(pCardInfo); AGTIAPI_PRINTK("agtiapi_ReleaseHBA: low level resource released\n"); diff --git a/sys/dev/pst/pst-iop.c b/sys/dev/pst/pst-iop.c index 03eca4d96286..353d41808800 100644 --- a/sys/dev/pst/pst-iop.c +++ b/sys/dev/pst/pst-iop.c @@ -136,7 +136,7 @@ iop_attach(void *arg) ident->vendor, ident->product); printf("pstiop: description=<%.16s> revision=<%.8s>\n", ident->description, ident->revision); - contigfree(reply, PAGE_SIZE, M_PSTIOP); + free(reply, M_PSTIOP); } #endif @@ -317,18 +317,18 @@ iop_get_lct(struct iop_softc *sc) msg->sgl.phys_addr[0] = vtophys(reply); if (iop_queue_wait_msg(sc, mfa, (struct i2o_basic_message *)msg)) { - contigfree(reply, ALLOCSIZE, M_PSTIOP); + free(reply, M_PSTIOP); return 0; } if (!(sc->lct = malloc(reply->table_size * sizeof(struct i2o_lct_entry), M_PSTIOP, M_NOWAIT | M_ZERO))) { - contigfree(reply, ALLOCSIZE, M_PSTIOP); + free(reply, M_PSTIOP); return 0; } bcopy(&reply->entry[0], sc->lct, reply->table_size * sizeof(struct i2o_lct_entry)); sc->lct_count = reply->table_size; - contigfree(reply, ALLOCSIZE, M_PSTIOP); + free(reply, M_PSTIOP); return 1; } @@ -374,10 +374,10 @@ iop_get_util_params(struct iop_softc *sc, int target, int operation, int group) if (iop_queue_wait_msg(sc, mfa, (struct i2o_basic_message *)msg) || reply->error_info_size) { - contigfree(reply, PAGE_SIZE, M_PSTIOP); + free(reply, M_PSTIOP); reply = NULL; } - contigfree(param, PAGE_SIZE, M_PSTIOP); + free(param, M_PSTIOP); return reply; } diff --git a/sys/dev/pst/pst-raid.c b/sys/dev/pst/pst-raid.c index 47739f02ee82..f1d66f7598ed 100644 --- a/sys/dev/pst/pst-raid.c +++ b/sys/dev/pst/pst-raid.c @@ -126,11 +126,11 @@ pst_attach(device_t dev) if (!(psc->info = (struct i2o_bsa_device *) malloc(sizeof(struct i2o_bsa_device), M_PSTRAID, M_NOWAIT))) { - contigfree(reply, PAGE_SIZE, M_PSTIOP); + free(reply, M_PSTIOP); return ENOMEM; } bcopy(reply->result, psc->info, sizeof(struct i2o_bsa_device)); - contigfree(reply, PAGE_SIZE, M_PSTIOP); + free(reply, M_PSTIOP); if (!(reply = iop_get_util_params(psc->iop, psc->lct->local_tid, I2O_PARAMS_OPERATION_FIELD_GET, @@ -148,7 +148,7 @@ pst_attach(device_t dev) bpack(ident->vendor, ident->vendor, 16); bpack(ident->product, ident->product, 16); sprintf(name, "%s %s", ident->vendor, ident->product); - contigfree(reply, PAGE_SIZE, M_PSTIOP); + free(reply, M_PSTIOP); bioq_init(&psc->queue); diff --git a/sys/dev/qat/qat/qat_ocf.c b/sys/dev/qat/qat/qat_ocf.c index b25135b6a678..3ec8f802f324 100644 --- a/sys/dev/qat/qat/qat_ocf.c +++ b/sys/dev/qat/qat/qat_ocf.c @@ -544,7 +544,7 @@ qat_ocf_session_init(device_t dev, fail: /* Release resources if any */ if (sessionCtx) - contigfree(sessionCtx, sessionCtxSize, M_QAT_OCF); + free(sessionCtx, M_QAT_OCF); return status; } @@ -610,9 +610,7 @@ qat_ocf_remove_session(device_t dev, } explicit_bzero(qat_session->sessionCtx, qat_session->sessionCtxSize); - contigfree(qat_session->sessionCtx, - qat_session->sessionCtxSize, - M_QAT_OCF); + free(qat_session->sessionCtx, M_QAT_OCF); qat_session->sessionCtx = NULL; qat_session->sessionCtxSize = 0; diff --git a/sys/dev/qat/qat_api/qat_utils/src/QatUtilsServices.c b/sys/dev/qat/qat_api/qat_utils/src/QatUtilsServices.c index 3134c2d375eb..bcd2d687acb2 100644 --- a/sys/dev/qat/qat_api/qat_utils/src/QatUtilsServices.c +++ b/sys/dev/qat/qat_api/qat_utils/src/QatUtilsServices.c @@ -91,7 +91,7 @@ qatUtilsMemFreeNUMA(void *ptr) "QatUtilsMemAlignedFree: Detected corrupted data: memory leak!\n"); return; } - contigfree(memInfo->mAllocMemPtr, memInfo->mSize, M_QAT); + free(memInfo->mAllocMemPtr, M_QAT); } CpaStatus diff --git a/sys/dev/virtio/gpu/virtio_gpu.c b/sys/dev/virtio/gpu/virtio_gpu.c index eac5b5db21b9..6f786a450900 100644 --- a/sys/dev/virtio/gpu/virtio_gpu.c +++ b/sys/dev/virtio/gpu/virtio_gpu.c @@ -371,8 +371,8 @@ vtgpu_detach(device_t dev) vt_deallocate(&vtgpu_fb_driver, &sc->vtgpu_fb_info); if (sc->vtgpu_fb_info.fb_vbase != 0) { MPASS(sc->vtgpu_fb_info.fb_size != 0); - contigfree((void *)sc->vtgpu_fb_info.fb_vbase, - sc->vtgpu_fb_info.fb_size, M_DEVBUF); + free((void *)sc->vtgpu_fb_info.fb_vbase, + M_DEVBUF); } /* TODO: Tell the host we are detaching */ diff --git a/sys/dev/virtio/virtqueue.c b/sys/dev/virtio/virtqueue.c index c92f635832f2..8cc3326dc08e 100644 --- a/sys/dev/virtio/virtqueue.c +++ b/sys/dev/virtio/virtqueue.c @@ -360,7 +360,7 @@ virtqueue_free(struct virtqueue *vq) virtqueue_free_indirect(vq); if (vq->vq_ring_mem != NULL) { - contigfree(vq->vq_ring_mem, vq->vq_ring_size, M_DEVBUF); + free(vq->vq_ring_mem, M_DEVBUF); vq->vq_ring_size = 0; vq->vq_ring_mem = NULL; } diff --git a/sys/dev/vmware/vmci/vmci_kernel_if.c b/sys/dev/vmware/vmci/vmci_kernel_if.c index c7cdf5e3e3d8..e5d5c5160803 100644 --- a/sys/dev/vmware/vmci/vmci_kernel_if.c +++ b/sys/dev/vmware/vmci/vmci_kernel_if.c @@ -236,10 +236,10 @@ vmci_alloc_kernel_mem(size_t size, int flags) */ void -vmci_free_kernel_mem(void *ptr, size_t size) +vmci_free_kernel_mem(void *ptr, size_t size __unused) { - contigfree(ptr, size, M_DEVBUF); + free(ptr, M_DEVBUF); } /* diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c index 2c5862232b41..b11972295a4b 100644 --- a/sys/dev/xen/blkfront/blkfront.c +++ b/sys/dev/xen/blkfront/blkfront.c @@ -1064,9 +1064,7 @@ xbd_free(struct xbd_softc *sc) gnttab_end_foreign_access_references( sc->xbd_max_request_indirectpages, &cm->cm_indirectionrefs[0]); - contigfree(cm->cm_indirectionpages, PAGE_SIZE * - sc->xbd_max_request_indirectpages, - M_XENBLOCKFRONT); + free(cm->cm_indirectionpages, M_XENBLOCKFRONT); cm->cm_indirectionpages = NULL; } @@ -1373,9 +1371,7 @@ xbd_connect(struct xbd_softc *sc) break; } if (j < sc->xbd_max_request_indirectpages) { - contigfree(indirectpages, - PAGE_SIZE * sc->xbd_max_request_indirectpages, - M_XENBLOCKFRONT); + free(indirectpages, M_XENBLOCKFRONT); break; } cm->cm_indirectionpages = indirectpages; |
