qcom: bam_dma: Delete useless kfree code
authorZheng Yongjun <zhengyongjun3@huawei.com>
Wed, 16 Dec 2020 13:06:49 +0000 (21:06 +0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 29 Dec 2020 04:38:00 +0000 (10:08 +0530)
The parameter of kfree function is NULL, so kfree code is useless, delete it.
Therefore, goto expression is no longer needed, so simplify it.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20201216130649.13979-1-zhengyongjun3@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/qcom/bam_dma.c

index d5773d4..8857985 100644 (file)
@@ -630,7 +630,7 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
                             GFP_NOWAIT);
 
        if (!async_desc)
-               goto err_out;
+               return NULL;
 
        if (flags & DMA_PREP_FENCE)
                async_desc->flags |= DESC_FLAG_NWD;
@@ -670,10 +670,6 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
        }
 
        return vchan_tx_prep(&bchan->vc, &async_desc->vd, flags);
-
-err_out:
-       kfree(async_desc);
-       return NULL;
 }
 
 /**