• Baolin Wang's avatar
    dmaengine: sprd: Fix the possible crash when getting descriptor status · 16d0f85e
    Baolin Wang authored
    We will get a NULL virtual descriptor by vchan_find_desc() when the descriptor
    has been submitted, that will crash the kernel when getting the descriptor
    status.
    
    In this case, since the descriptor has been submitted to process, but it
    is not completed now, which means the descriptor is listed into the
    'vc->desc_submitted' list now. So we can not get current processing descriptor
    by vchan_find_desc(), but the pointer 'schan->cur_desc' will point to the
    current processing descriptor, then we can use 'schan->cur_desc' to get
    current processing descriptor's status to avoid this issue.
    Signed-off-by: default avatarBaolin Wang <baolin.wang@linaro.org>
    Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
    16d0f85e
sprd-dma.c 32.5 KB