]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dmaengine: at_xdmac: avoid null_prt_deref in at_xdmac_prep_dma_memset
authorChen Ridong <chenridong@huawei.com>
Tue, 29 Oct 2024 08:28:45 +0000 (08:28 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2025 12:24:57 +0000 (13:24 +0100)
commited1a8aaa344522c0c349ac9042db27ad130ef913
treefde986143ab6d0d3856e4a6f26d4d04308cd5a02
parente87dbcfdf1c0854a1f88bae5beed22bee9264585
dmaengine: at_xdmac: avoid null_prt_deref in at_xdmac_prep_dma_memset

commit c43ec96e8d34399bd9dab2f2dc316b904892133f upstream.

The at_xdmac_memset_create_desc may return NULL, which will lead to a
null pointer dereference. For example, the len input is error, or the
atchan->free_descs_list is empty and memory is exhausted. Therefore, add
check to avoid this.

Fixes: b206d9a23ac7 ("dmaengine: xdmac: Add memset support")
Signed-off-by: Chen Ridong <chenridong@huawei.com>
Link: https://lore.kernel.org/r/20241029082845.1185380-1-chenridong@huaweicloud.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/at_xdmac.c