Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp633668iol; Thu, 9 Jun 2022 10:32:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpZqOuQnEjhbxW//iV0jhQFU0DU1ou7vYbSN0iISOq9qW9crC2mx/fzoaEU9ZV0fUAdw5v X-Received: by 2002:a17:90b:33c5:b0:1e3:e57a:8998 with SMTP id lk5-20020a17090b33c500b001e3e57a8998mr4450559pjb.54.1654795927796; Thu, 09 Jun 2022 10:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654795927; cv=none; d=google.com; s=arc-20160816; b=mdA1aan4LIxAFplnw8ToqrYyPM2szuxFWoSzYI+ARdY6R0H1kvoZ3mnSxIRX27UHRP C8d5V3WaM1TuvJOa+WcHRnBUp0uOAfcWqDZSg7bby0ojAGfo1znmUiqHIx3Na1sMSN9M V0gsZKBKtaJDC9lmBGbqQlM/8iBMHU+S7kWzdI3/LUpMz5p8cT07zdb+vg7Mpby1i7+T Hs2tY7yU88B1e5bEwEA2iW5pPm/1YzPb/Pfq0ZE70g/spqXnjypcgtSvu2WiOK+OT06V nVMHOx7TwDiO2CZKwOPnzhXM7USqtDihC9TbGDk0NyDerMQltnnc/mOWbUpiT2GIj1k9 lf3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=/2Ey+JStqEb0EZ1vUzOJkHkgZ7LjN7M13J/6E9IIyVA=; b=o5lJIYKgTByoosClq0cCD294dOAyh+5NhWP4ZbumBNSfatSqTXVXYZUynQ7Xa5NVnL GstrfpcG0OVkQqr6kxiJZznsO14tP/UPZVHKm0g1QKz29lAA3M0op+KqkZ2ihdJm3uLS g6SDkGJlp0tnSneiWNyPyMwZ5Gseln9vdhPLjC2qPKK1UuicR2JIDSPyy/J4mnnM1g9l X+Cn6ifeVSN8CW+RB7WBXoSx1IcHyzRS/7NZvqQ8wCaa2XY1uwQKgiOpEmYU0RfRm1Mm hi9OSy11zn3DEtn1o2+utj5lLlnFwW8ylhDV8+WFnVFMgubQBfEm9J1KBNf9H+YVCVoT suLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Rdx7tb9Y; dkim=neutral (no key) header.i=@linutronix.de header.b=KBivTDbs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pf5-20020a17090b1d8500b001e34551c962si34244848pjb.80.2022.06.09.10.31.54; Thu, 09 Jun 2022 10:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Rdx7tb9Y; dkim=neutral (no key) header.i=@linutronix.de header.b=KBivTDbs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344829AbiFIQut (ORCPT + 99 others); Thu, 9 Jun 2022 12:50:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344443AbiFIQuc (ORCPT ); Thu, 9 Jun 2022 12:50:32 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 033E069B5A for ; Thu, 9 Jun 2022 09:50:28 -0700 (PDT) Date: Thu, 09 Jun 2022 16:50:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1654793427; 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=/2Ey+JStqEb0EZ1vUzOJkHkgZ7LjN7M13J/6E9IIyVA=; b=Rdx7tb9YVYv8bK91J80smmh/HlBB3zyPafvsFVzHvb1hpESe3N7dZflCw4mxGJRlhjgUFf o/kGulbJqbInol6+ApHJqWPQUTHyGP0LRgEdXoZkaBSFu1nfkbFj8zpqjacHRrbT/dgEDK HL/tjmtsojOAj7iDj6vz0RBspAgmFmhjiIW6ceYAFI+qSRpqbwHI1bq7hUyyXPUWV29aF/ 6z+3pQNuWPtuk2cNAU69Ij8u8UoRI3BMfI3Ve+pfpjE60O9hDQTeiJl+zfUhaU97Z4IpxI CdfzKw8WP15xa8P4geEQLUguYQrvX2JDs0pPUZtS3mStAKZLNDuEvW3LckKFxg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1654793427; 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=/2Ey+JStqEb0EZ1vUzOJkHkgZ7LjN7M13J/6E9IIyVA=; b=KBivTDbs2w+PlLQKPjJRBJ4DQIFCHdRUg41566ZYHb5+egD6OG7ZxRqFG3EdZKklYFPLca 34254wiDrPg7zYDQ== From: "irqchip-bot for Miaoqian Lin" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-fixes] irqchip/gic-v3: Fix error handling in gic_populate_ppi_partitions Cc: Miaoqian Lin , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20220601080930.31005-5-linmq006@gmail.com> References: <20220601080930.31005-5-linmq006@gmail.com> MIME-Version: 1.0 Message-ID: <165479342600.4207.2766213608831245378.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: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/irqchip-fixes branch of irqchip: Commit-ID: ec8401a429ffee34ccf38cebf3443f8d5ae6cb0d Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/ec8401a429ffee34ccf38cebf3443f8d5ae6cb0d Author: Miaoqian Lin AuthorDate: Wed, 01 Jun 2022 12:09:28 +04:00 Committer: Marc Zyngier CommitterDate: Thu, 09 Jun 2022 17:36:57 +01:00 irqchip/gic-v3: Fix error handling in gic_populate_ppi_partitions of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. When kcalloc fails, it missing of_node_put() and results in refcount leak. Fix this by goto out_put_node label. Fixes: 52085d3f2028 ("irqchip/gic-v3: Dynamically allocate PPI partition descriptors") Signed-off-by: Miaoqian Lin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220601080930.31005-5-linmq006@gmail.com --- drivers/irqchip/irq-gic-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 2be8dea..1d5b475 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1932,7 +1932,7 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node) gic_data.ppi_descs = kcalloc(gic_data.ppi_nr, sizeof(*gic_data.ppi_descs), GFP_KERNEL); if (!gic_data.ppi_descs) - return; + goto out_put_node; nr_parts = of_get_child_count(parts_node);