Have you tried the manual page http://man.openbsd.org/bus_dma.9 ?
On Thu, Oct 13, 2016 at 12:39 AM, <co...@sdf.org> wrote: > On Wed, Oct 12, 2016 at 04:26:20PM -0400, Joe Nosay wrote: > > Where in the code is the problem? > > > > On Tue, Oct 11, 2016 at 11:49 PM, <co...@sdf.org> wrote: > > > > 836 vd = malloc(sizeof(struct vdsk_dring), M_DEVBUF, M_NOWAIT); > 837 if (vd == NULL) > 838 return NULL; > 839 > > assuming this suceeds... > > 840 size = roundup(nentries * sizeof(struct vd_desc), PAGE_SIZE); > 841 > 842 if (bus_dmamap_create(t, size, 1, size, 0, > 843 BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &vd->vd_map) != 0) > 844 return (NULL); > > but this fails. > > Now we return NULL, due to failure. but there's no reference to vd > which will allow us to free it later. > > (I may be misunderstanding what bus_dmamap_create does, but probably not. >