Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: df7e762db5f6 ("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>

authored by

Johan Hovold and committed by
Vinod Koul
b1b590a5 dd6e4943

+3 -1
+3 -1
drivers/dma/stm32/stm32-dmamux.c
··· 143 143 ret = pm_runtime_resume_and_get(&pdev->dev); 144 144 if (ret < 0) { 145 145 spin_unlock_irqrestore(&dmamux->lock, flags); 146 - goto error; 146 + goto err_put_dma_spec_np; 147 147 } 148 148 spin_unlock_irqrestore(&dmamux->lock, flags); 149 149 ··· 165 165 166 166 return mux; 167 167 168 + err_put_dma_spec_np: 169 + of_node_put(dma_spec->np); 168 170 error: 169 171 clear_bit(mux->chan_id, dmamux->dma_inuse); 170 172