3.12 Backport: fixed dma memory leaks, via 4b6271a64463f4fcbaf8b2e1d84704b7eb8c407c; 7261828776b33ff434837674413df2920e9ca2ff