fix bug in mkDMAWriteBuffer and mkDMAReadBuffer