dmaengine: mmp_tdma: Do not ignore slave config validation errors
authorLubomir Rintel <lkundrak@v3.sk>
Sun, 19 Apr 2020 16:49:06 +0000 (18:49 +0200)
committerVinod Koul <vkoul@kernel.org>
Thu, 23 Apr 2020 07:12:51 +0000 (12:42 +0530)
With an invalid dma_slave_config set previously,
mmp_tdma_prep_dma_cyclic() would detect an error whilst configuring the
channel, but proceed happily on:

  [  120.756530] mmp-tdma d42a0800.adma: mmp_tdma: unknown burst size.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Link: https://lore.kernel.org/r/20200419164912.670973-2-lkundrak@v3.sk
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/mmp_tdma.c

index 10117f271b12b2cfb540438b4cd979e92da3d265..51e08c16756ae3bc17ac3f9fa46d697662552386 100644 (file)
@@ -443,7 +443,8 @@ static struct dma_async_tx_descriptor *mmp_tdma_prep_dma_cyclic(
        if (!desc)
                goto err_out;
 
-       mmp_tdma_config_write(chan, direction, &tdmac->slave_config);
+       if (mmp_tdma_config_write(chan, direction, &tdmac->slave_config))
+               goto err_out;
 
        while (buf < buf_len) {
                desc = &tdmac->desc_arr[i];