Skip to content

Commit eabe40f

Browse files
jhovoldgregkh
authored andcommitted
dmaengine: dw: dmamux: fix OF node leak on route allocation failure
commit ec25e60f9f95464aa11411db31d0906b3fb7b9f2 upstream. Make sure to drop the reference taken to the DMA master OF node also on late route allocation failures. Fixes: 134d9c5 ("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: Johan Hovold <johan@kernel.org> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://patch.msgid.link/20251117161258.10679-6-johan@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9b3cff9 commit eabe40f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/dma/dw/rzn1-dmamux.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void *rzn1_dmamux_route_allocate(struct of_phandle_args *dma_spec,
9090

9191
if (test_and_set_bit(map->req_idx, dmamux->used_chans)) {
9292
ret = -EBUSY;
93-
goto free_map;
93+
goto put_dma_spec_np;
9494
}
9595

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

104104
clear_bitmap:
105105
clear_bit(map->req_idx, dmamux->used_chans);
106+
put_dma_spec_np:
107+
of_node_put(dma_spec->np);
106108
free_map:
107109
kfree(map);
108110
put_device:

0 commit comments

Comments
 (0)