]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
dmaengine: ti: edma: Fix error return code in edma_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 12 Dec 2019 11:46:22 +0000 (11:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:38:01 +0000 (08:38 +0100)
[ Upstream commit d1fd03a35efc6285e43f4ef35ef04dbf2c9389c6 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/ti/edma.c

index 0628ee4bf1b41f3c692b38befcd910a620ef5e2f..03a7f647f7b2c8fdd1a9c42752ece5e81e057bdf 100644 (file)
@@ -2342,8 +2342,10 @@ static int edma_probe(struct platform_device *pdev)
        ecc->channels_mask = devm_kcalloc(dev,
                                           BITS_TO_LONGS(ecc->num_channels),
                                           sizeof(unsigned long), GFP_KERNEL);
-       if (!ecc->slave_chans || !ecc->slot_inuse || !ecc->channels_mask)
+       if (!ecc->slave_chans || !ecc->slot_inuse || !ecc->channels_mask) {
+               ret = -ENOMEM;
                goto err_disable_pm;
+       }
 
        /* Mark all channels available initially */
        bitmap_fill(ecc->channels_mask, ecc->num_channels);