Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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>

authored by

Wei Yongjun and committed by
Vinod Koul
d1fd03a3 a5b982af

+3 -1
+3 -1
drivers/dma/ti/edma.c
··· 2342 2342 ecc->channels_mask = devm_kcalloc(dev, 2343 2343 BITS_TO_LONGS(ecc->num_channels), 2344 2344 sizeof(unsigned long), GFP_KERNEL); 2345 - if (!ecc->slave_chans || !ecc->slot_inuse || !ecc->channels_mask) 2345 + if (!ecc->slave_chans || !ecc->slot_inuse || !ecc->channels_mask) { 2346 + ret = -ENOMEM; 2346 2347 goto err_disable_pm; 2348 + } 2347 2349 2348 2350 /* Mark all channels available initially */ 2349 2351 bitmap_fill(ecc->channels_mask, ecc->num_channels);