From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D43A33B52F1; Wed, 21 Jan 2026 18:36:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769020598; cv=none; b=kKZ2XZe5LNxZdrQzweDdcC2dL24wcIzzRaB0W7JYc/XRFbg7pyxnVu++vzP3nvmRwZFg0V2/kr3hoWSsb0dhhyiUN8UYcLsDf1YjD1LCVohaz1xfU2QitmCUzieF5R0IGEQbnzYRJx8aQsSO6z0nGfrXwl7kF5GCY2jK/FQhCUg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769020598; c=relaxed/simple; bh=0NP5CzxPVcVP8eiY6hhzs/iv4/+52VK3dYJZGirmhys=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sKSzhLbenMz9qLBRPqFA7GP7YCDjCFJP84IUaglK1t2NxivVBjAVo/WzcOZpji8iMIMP5/su327QqR5SkBBx54LeDe0k5Dkk8VQI5d5JvvLQeOzN6kVAxXZ+QhnThXBrGNLyAQHOO3vok+bx4C96fF8uILk3l2XbWjfWreQmmGQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=L5WsiK6o; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="L5WsiK6o" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1E74C4AF0C; Wed, 21 Jan 2026 18:36:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1769020598; bh=0NP5CzxPVcVP8eiY6hhzs/iv4/+52VK3dYJZGirmhys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L5WsiK6o+Mk1zIZVoRru/KEMqc3UkcCA0jZ2VYS3QNrWeh2R/62EPP/r+CWz4lguq 3fp3f8zTFT6Wz6TWfKJMaiuc2ekfYNIYVB0Llmy4BLm4eDenuC3bTGlTJULFoeSOx4 gzbywAdphFjomqovIqQ/zgUuhRNII+HrWpm61yRg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pierre-Yves MORDRET , Johan Hovold , Amelie Delaunay , Vinod Koul Subject: [PATCH 6.18 180/198] dmaengine: stm32: dmamux: fix OF node leak on route allocation failure Date: Wed, 21 Jan 2026 19:16:48 +0100 Message-ID: <20260121181425.028605101@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260121181418.537774329@linuxfoundation.org> References: <20260121181418.537774329@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit b1b590a590af13ded598e70f0b72bc1e515787a1 upstream. 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 Signed-off-by: Johan Hovold Reviewed-by: Amelie Delaunay Link: https://patch.msgid.link/20251117161258.10679-12-johan@kernel.org Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/stm32/stm32-dmamux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/dma/stm32/stm32-dmamux.c +++ b/drivers/dma/stm32/stm32-dmamux.c @@ -143,7 +143,7 @@ static void *stm32_dmamux_route_allocate ret = pm_runtime_resume_and_get(&pdev->dev); if (ret < 0) { spin_unlock_irqrestore(&dmamux->lock, flags); - goto error; + goto err_put_dma_spec_np; } spin_unlock_irqrestore(&dmamux->lock, flags); @@ -165,6 +165,8 @@ static void *stm32_dmamux_route_allocate return mux; +err_put_dma_spec_np: + of_node_put(dma_spec->np); error: clear_bit(mux->chan_id, dmamux->dma_inuse);