[PATCH 0/2] dmaengine: Add cleanup to simple code

Frank Li Frank.Li at nxp.com
Thu Oct 2 12:49:40 PDT 2025


start_dma()
{
        struct dma_async_tx_descriptor *rx_cmd_desc __free(dma_async_tx_descriptor) = NULL;
        ...
        cookie = dmaengine_submit(rx_cmd_desc);
        if (dma_submit_error(cookie))
                return dma_submit_error(cookie);
        ...
        retain_and_null_ptr(rx_cmd_desc);

        return 0;
}

To: Vinod Koul <vkoul at kernel.org>
To: Dong Aisheng <aisheng.dong at nxp.com>
To: Andi Shyti <andi.shyti at kernel.org>
To: Shawn Guo <shawnguo at kernel.org>
To: Sascha Hauer <s.hauer at pengutronix.de>
To: Pengutronix Kernel Team <kernel at pengutronix.de>
To: Fabio Estevam <festevam at gmail.com>
Cc: dmaengine at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-i2c at vger.kernel.org
Cc: imx at lists.linux.dev
Cc: linux-arm-kernel at lists.infradead.org
Cc: carlos.song at nxp.com

Signed-off-by: Frank Li <Frank.Li at nxp.com>
---
Frank Li (2):
      dmaengine: Add cleanup FREE defines for dma_async_tx_descriptor
      i2c: lpi2c: Use cleanup helper for dma_async_tx_descriptor error handling

 drivers/i2c/busses/i2c-imx-lpi2c.c | 11 +++--------
 include/linux/dmaengine.h          |  4 +++-
 2 files changed, 6 insertions(+), 9 deletions(-)
---
base-commit: 019ffdd87705bcef1ca5cf9bfdd2b358ce190ab5
change-id: 20251001-dma_chan_free-0392f4004d9e

Best regards,
--
Frank Li <Frank.Li at nxp.com>




More information about the linux-arm-kernel mailing list