• Baolin Wang's avatar
    dmaengine: sprd: Fix the possible crash when getting descriptor status · af410491
    Baolin Wang authored
    [ Upstream commit 16d0f85e ]
    
    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>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    af410491
sprd-dma.c 32.5 KB