moved allocation before opening dma pipe