From: Wei Yongjun weiyongjun1@huawei.com
mainline inclusion from mainline-v5.6-rc1 commit d1fd03a35efc6285e43f4ef35ef04dbf2c9389c6 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/?i...
--------------------------------
Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function.
Fixes: 2a03c1314506 ("dmaengine: ti: edma: add missed operations") Signed-off-by: Wei Yongjun weiyongjun1@huawei.com Acked-by: Peter Ujfalusi peter.ujfalusi@ti.com Link: https://lore.kernel.org/r/20191212114622.127322-1-weiyongjun1@huawei.com Signed-off-by: Vinod Koul vkoul@kernel.org Conflicts: drivers/dma/ti/edma.c Signed-off-by: GUO Zihua guozihua@huawei.com --- drivers/dma/ti/edma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c index 800271647574..c35fe3d82670 100644 --- a/drivers/dma/ti/edma.c +++ b/drivers/dma/ti/edma.c @@ -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;