]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dmaengine: ti: dma-crossbar: fix device leak on dra7x route allocation
authorJohan Hovold <johan@kernel.org>
Mon, 17 Nov 2025 16:12:55 +0000 (17:12 +0100)
committerVinod Koul <vkoul@kernel.org>
Sun, 14 Dec 2025 09:17:24 +0000 (14:47 +0530)
Make sure to drop the reference taken when looking up the crossbar
platform device during dra7x route allocation.

Note that commit 615a4bfc426e ("dmaengine: ti: Add missing put_device in
ti_dra7_xbar_route_allocate") fixed the leak in the error paths but the
reference is still leaking on successful allocation.

Fixes: a074ae38f859 ("dmaengine: Add driver for TI DMA crossbar on DRA7x")
Fixes: 615a4bfc426e ("dmaengine: ti: Add missing put_device in ti_dra7_xbar_route_allocate")
Cc: stable@vger.kernel.org # 4.2: 615a4bfc426e
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20251117161258.10679-14-johan@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ti/dma-crossbar.c

index 7f17ee87a6dce36958fbccecbadf6debba84395e..e52b0e1399008fa8c31ee4c1ce26cfeaee784a51 100644 (file)
@@ -288,6 +288,8 @@ static void *ti_dra7_xbar_route_allocate(struct of_phandle_args *dma_spec,
 
        ti_dra7_xbar_write(xbar->iomem, map->xbar_out, map->xbar_in);
 
+       put_device(&pdev->dev);
+
        return map;
 }