Commit f8fe8939 authored by Wei Yongjun's avatar Wei Yongjun Committed by GUO Zihua
Browse files

dmaengine: ti: edma: Fix error return code in edma_probe()

mainline inclusion
from mainline-v5.6-rc1
commit d1fd03a3
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9E2MP
CVE: CVE-2024-26771

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d1fd03a35efc6285e43f4ef35ef04dbf2c9389c6



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

Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 2a03c131 ("dmaengine: ti: edma: add missed operations")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20191212114622.127322-1-weiyongjun1@huawei.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
Conflicts:
	drivers/dma/ti/edma.c
Signed-off-by: default avatarGUO Zihua <guozihua@huawei.com>
parent fbdb41fc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2267,8 +2267,10 @@ static int edma_probe(struct platform_device *pdev)

	ecc->slot_inuse = devm_kcalloc(dev, BITS_TO_LONGS(ecc->num_slots),
				       sizeof(unsigned long), GFP_KERNEL);
	if (!ecc->slave_chans || !ecc->slot_inuse)
	if (!ecc->slave_chans || !ecc->slot_inuse) {
		ret = -ENOMEM;
		goto err_disable_pm;
	}

	ecc->default_queue = info->default_queue;