dma/shdma: move dereference below the NULL check