• Huang Shijie's avatar
    dmaengine: mic_x100_dma: use devm_kzalloc to fix an issue · 111b009f
    Huang Shijie authored
    The following patch introduced an issue.
        commit f6206f00 ("dmaengine: mic_x100_dma: use the new helper to simplify the code")
    
    This issue is :
    
    	kfree(mic_dma_dev)
    	.....
    	dma_async_device_unregister(mic_dma_dev->device);
    
    Free the memory, and use it again.
    
    So use devm_kzalloc to allocate mic_dma_dev to fix it.
    
    When the Devres try to release the resources, it will call release at the
    following order:
    
    	dma_async_device_unregister(mic_dma_dev->device);
    	.....
    	kfree(mic_dma_dev)
    
    Fixes: f6206f00 ("dmaengine: mic_x100_dma: use the new helper to simplify the code")
    Signed-off-by: default avatarHuang Shijie <sjhuang@iluvatar.ai>
    Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
    111b009f
mic_x100_dma.c 21.3 KB