Commit ec25e60f authored by Johan Hovold's avatar Johan Hovold Committed by Vinod Koul
Browse files

dmaengine: dw: dmamux: fix OF node leak on route allocation failure



Make sure to drop the reference taken to the DMA master OF node also on
late route allocation failures.

Fixes: 134d9c52 ("dmaengine: dw: dmamux: Introduce RZN1 DMA router support")
Cc: stable@vger.kernel.org	# 5.19
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Reviewed-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://patch.msgid.link/20251117161258.10679-6-johan@kernel.org


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 7bb7d696
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ static void *rzn1_dmamux_route_allocate(struct of_phandle_args *dma_spec,

	if (test_and_set_bit(map->req_idx, dmamux->used_chans)) {
		ret = -EBUSY;
		goto free_map;
		goto put_dma_spec_np;
	}

	mask = BIT(map->req_idx);
@@ -103,6 +103,8 @@ static void *rzn1_dmamux_route_allocate(struct of_phandle_args *dma_spec,

clear_bitmap:
	clear_bit(map->req_idx, dmamux->used_chans);
put_dma_spec_np:
	of_node_put(dma_spec->np);
free_map:
	kfree(map);
put_device: