Skip to content

Commit b1b590a

Browse files
jhovoldvinodkoul
authored andcommitted
dmaengine: stm32: 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: df7e762 ("dmaengine: Add STM32 DMAMUX driver") Cc: stable@vger.kernel.org # 4.15 Cc: Pierre-Yves MORDRET <pierre-yves.mordret@foss.st.com> Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com> Link: https://patch.msgid.link/20251117161258.10679-12-johan@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent dd6e494 commit b1b590a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/dma/stm32/stm32-dmamux.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec,
143143
ret = pm_runtime_resume_and_get(&pdev->dev);
144144
if (ret < 0) {
145145
spin_unlock_irqrestore(&dmamux->lock, flags);
146-
goto error;
146+
goto err_put_dma_spec_np;
147147
}
148148
spin_unlock_irqrestore(&dmamux->lock, flags);
149149

@@ -165,6 +165,8 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec,
165165

166166
return mux;
167167

168+
err_put_dma_spec_np:
169+
of_node_put(dma_spec->np);
168170
error:
169171
clear_bit(mux->chan_id, dmamux->dma_inuse);
170172

0 commit comments

Comments
 (0)