From patchwork Wed Jun 1 08:09:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaoqian Lin X-Patchwork-Id: 12866482 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A3BF1C433EF for ; Wed, 1 Jun 2022 08:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WszeIpLxciQRhA886JzxF3IyzO97OATrsDR9fpRqtFI=; b=XNmENoEcTT/hMT Ziw1bspQrbfMZy4Di0ND2ZjxNlcCQqLu4Z/qTI6IdDN/mgb/hdNTgsBJWaudLwVwXhAKF/49y1FhI gPZHcRPl6G1oOjdejzeTavWZn6J5FKO2iBOAVlmmzS16Hru7zLAj8SyjmXp/O8ysv5JkcROp4VuzR E2TESIRFsYO0YvS48kyEPkO7m9higm6pyJ5XXjKpjS9kBTmMh22GPgYDKkfTyxSlYO3q+/9UU5NYe bZcva9/PvjD4j2U1t6AfwwKe+yMoJV4dOI03tP13jM9TBVJn6z/GJis1RhegAVjKqDIKSuj4OJq3B I1WZ7mZGQ5EqrywlTBvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJSX-00EXvD-BM; Wed, 01 Jun 2022 08:12:05 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJSU-00EXpM-Jh for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 08:12:03 +0000 Received: by mail-pj1-x1034.google.com with SMTP id n13-20020a17090a394d00b001e30a60f82dso5440578pjf.5 for ; Wed, 01 Jun 2022 01:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GWjGR+uUnc6AYWehSdkH/qKXs6QNn54ho2G5cZ8+zoc=; b=lO2Wb90PRtDZzwh2kw70sxt7A/gYeEkNtkUsS3yqAgTMWQOTDGZva4fzz7aMr+4i5C DJAuNZ4iAMF68sPTRHzMJwT0Ko9mpjCrn5dt1zjSqBBanJ9PRMJxrCYZNz4YWoScI+1f tE3E9sl6Ug1NFOXH6ezkTyoj2yQg7spcEAyiADgR5vbMerxjw85BIzJx6mpN2QjVo2t7 bdc20Jtg3vL2gHqJj4G3MOIICtESleFZOhnw3LRN/i+ngeEg78csnWrvfMl4QGJjwdbm SyXqchhjD+rYzhWdJtf7b3EAyHxKrGzJOCN9iK5lTZYEI4lrsn0WflvXFUnPLmiCCfYZ t+jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GWjGR+uUnc6AYWehSdkH/qKXs6QNn54ho2G5cZ8+zoc=; b=iWn2+gxgZh20hOBSFWtcVdL2U5GyuCZxBDkreOfGAmrTjMWDrdvCP9GXIxN1zPuKAk 9vX51IIN52uYerbzIdo6GPdWgMUVTj25KEr37rNqnop9pnTib5IQ5/bWUqgKJedFw6O7 oF3Azv2WHxCKvilPjYb/U5JK9Yv9W6KoFD63R6pSr87uyqF/7Sk/AxqmyxxFBbhoHVqb XrT2XCcUX0c5bP9roYFzt213ENP+1iEBFBGz8rAUTA0qj382+qeEZ0egzjDq9rul6SyA DAumqN5/di87JpB68l6MFf/jKfqaZlxt4CvaRmG361uKbAWgHtTgkuExpEBGyjOZ/kkc 6iGg== X-Gm-Message-State: AOAM533l6TE5/0CCG0PaXRQ2YP5V1giV7uJ0uQElH5lr9PV7aVGJJKOG FNitLPqbYlBG+gr3Gz2/7LM= X-Google-Smtp-Source: ABdhPJyELGcS1L/91yKuLn5SIOvjSQzhnoeJComUUBK/MJj1z2x7Sd+TlkrWgVt8POtKp+07fMGkLQ== X-Received: by 2002:a17:90b:1e4f:b0:1e0:b91:39ef with SMTP id pi15-20020a17090b1e4f00b001e00b9139efmr32876048pjb.51.1654071109571; Wed, 01 Jun 2022 01:11:49 -0700 (PDT) Received: from localhost.localdomain ([202.120.234.246]) by smtp.googlemail.com with ESMTPSA id y1-20020a17090ad0c100b001e2f3831102sm792288pjw.17.2022.06.01.01.11.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 01:11:49 -0700 (PDT) From: Miaoqian Lin To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Thomas Gleixner , Marc Zyngier , Linus Walleij , Birger Koblitz , John Crispin , Bert Vermeulen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Miaoqian Lin Subject: [PATCH 3/6] irqchip/apple-aic: Fix refcount leak in aic_of_ic_init Date: Wed, 1 Jun 2022 12:09:27 +0400 Message-Id: <20220601080930.31005-4-linmq006@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601080930.31005-1-linmq006@gmail.com> References: <20220601080930.31005-1-linmq006@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_011202_664724_3F3EC524 X-CRM114-Status: GOOD ( 12.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: a5e8801202b3 ("irqchip/apple-aic: Parse FIQ affinities from device-tree") Signed-off-by: Miaoqian Lin --- drivers/irqchip/irq-apple-aic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c index 478d0af16d9f..5ac83185ff47 100644 --- a/drivers/irqchip/irq-apple-aic.c +++ b/drivers/irqchip/irq-apple-aic.c @@ -1144,6 +1144,7 @@ static int __init aic_of_ic_init(struct device_node *node, struct device_node *p for_each_child_of_node(affs, chld) build_fiq_affinity(irqc, chld); } + of_node_put(affs); set_handle_irq(aic_handle_irq); set_handle_fiq(aic_handle_fiq);