Commit 0bdb38a8 authored by Nikita Zhandarovich's avatar Nikita Zhandarovich Committed by sanglipeng
Browse files

ASoC: fsl_asrc_dma: fix potential null-ptr-deref

stable inclusion
from stable-v5.10.179
commit 4ab5f8f9d026bd6e66827c5993179bab42fc8f51
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8C809

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4ab5f8f9d026bd6e66827c5993179bab42fc8f51



--------------------------------

commit 86a24e99 upstream.

dma_request_slave_channel() may return NULL which will lead to
NULL pointer dereference error in 'tmp_chan->private'.

Correct this behaviour by, first, switching from deprecated function
dma_request_slave_channel() to dma_request_chan(). Secondly, enable
sanity check for the resuling value of dma_request_chan().
Also, fix description that follows the enacted changes and that
concerns the use of dma_request_slave_channel().

Fixes: 706e2c88 ("ASoC: fsl_asrc_dma: Reuse the dma channel if available in Back-End")
Co-developed-by: default avatarNatalia Petrova <n.petrova@fintech.ru>
Signed-off-by: default avatarNikita Zhandarovich <n.zhandarovich@fintech.ru>
Acked-by: default avatarShengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20230417133242.53339-1-n.zhandarovich@fintech.ru


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 35818520
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment