From nobody Fri Sep 19 07:36:28 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13DAAC43217 for ; Sat, 26 Nov 2022 13:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbiKZNei (ORCPT ); Sat, 26 Nov 2022 08:34:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbiKZNec (ORCPT ); Sat, 26 Nov 2022 08:34:32 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E69D619298 for ; Sat, 26 Nov 2022 05:34:31 -0800 (PST) Date: Sat, 26 Nov 2022 13:34:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669469670; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FApH4WYqnnPnCwRs252w67TbC7zTXDysxpl2cWjUjB8=; b=gLVa7yvsaj2c/WZvbMLTTLm4DXCJ2D0sg1TAaB4Susl6plHC5g6GXlCVvwZcPlbTsn1ZYA P4+rhJkc+/uyLpPwjEmFriwPIte83tp6sCGF5Nx8f9hX209co0niKsu5UQg5+SzTwC62GZ fp3JOJuFQxa5jkhNo/k87BPwQjM/tdxwxvwNvNYu0HlQAUEP9iad/2TNB+KpMaKgXfI5Mq GWsQXQeIcR+XtSvN9+1eJ0Cv8yrPAP/+j3EeuUpL7BfhaiccOsE36cetPXQrPVdjsinqI4 GTrjNfxR5X1dJetxYAqkuC4mxXuMXM1x07kvofeWPRcRdu7o2qd5WYzJ/uvBnw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669469670; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FApH4WYqnnPnCwRs252w67TbC7zTXDysxpl2cWjUjB8=; b=/13bOpW6JOnt9mQ72+josj1uphNkFVP+VZ1AuJeT1ePkP/uz4gp9MlOIp7u3Q2uijNLYts jSD2qYfbvHaebyCw== From: "irqchip-bot for Wei Yongjun" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/wpcm450: Fix memory leak in wpcm450_aic_of_init() Cc: Wei Yongjun , j.neuschaefer@gmx.net, Marc Zyngier , tglx@linutronix.de In-Reply-To: <20221115092532.1704032-1-weiyongjun@huaweicloud.com> References: <20221115092532.1704032-1-weiyongjun@huaweicloud.com> MIME-Version: 1.0 Message-ID: <166946966925.4906.3717360312262701265.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/irqchip-next branch of ir= qchip: Commit-ID: 4208d4faf36573a507b5e5de17abe342e9276759 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-plat= forms/4208d4faf36573a507b5e5de17abe342e9276759 Author: Wei Yongjun AuthorDate: Tue, 15 Nov 2022 09:25:32=20 Committer: Marc Zyngier CommitterDate: Sat, 26 Nov 2022 13:29:48=20 irqchip/wpcm450: Fix memory leak in wpcm450_aic_of_init() If of_iomap() failed, 'aic' should be freed before return. Otherwise there is a memory leak. Fixes: fead4dd49663 ("irqchip: Add driver for WPCM450 interrupt controller") Signed-off-by: Wei Yongjun Reviewed-by: Jonathan Neusch=C3=A4fer Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221115092532.1704032-1-weiyongjun@huaweic= loud.com --- drivers/irqchip/irq-wpcm450-aic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/irqchip/irq-wpcm450-aic.c b/drivers/irqchip/irq-wpcm45= 0-aic.c index 0dcbeb1..91df62a 100644 --- a/drivers/irqchip/irq-wpcm450-aic.c +++ b/drivers/irqchip/irq-wpcm450-aic.c @@ -146,6 +146,7 @@ static int __init wpcm450_aic_of_init(struct device_nod= e *node, aic->regs =3D of_iomap(node, 0); if (!aic->regs) { pr_err("Failed to map WPCM450 AIC registers\n"); + kfree(aic); return -ENOMEM; } =20