From patchwork Wed Jun 1 08:09:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miaoqian Lin X-Patchwork-Id: 12866477 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 22FC0C433F5 for ; Wed, 1 Jun 2022 08:12: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: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:In-Reply-To:References: List-Owner; bh=bfEI33fXHpTu5VK9ergwG+/oZKmRV6tXBzUZaZGsJuM=; b=V5m8vr5i0a0HUC X78/y7N4iWOpcqwTWw4Uwyg0VQC4N8gCcuFWQrfx3ELfi+bHN6PanEbOPaHtrJYEg0WMPXwBE6MpG rDT3YDKGNz9BWFjILYdbcNtNooXGXpHdGICxXsngCHkSGuUFpecSjVqT70wUbZVzyMZ2kHUEla1Ex wx8qpZBSeCP55O0uE2rL91F7fsAY1xD/Wrf865fNRBDT2XrJyWQelELBtqHL0iETemE+1zQRjjQYL OqsW+hb5aRyt0v109QkRUsYPanJL39IfKiH3O/BVS2k6UXnF7Lhr9bD6Key121nu8IiZZ/o1fFco0 wg/qA1xgmgcGaoiv5jdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJRs-00EXi5-Cj; Wed, 01 Jun 2022 08:11:24 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJRo-00EXgL-J7 for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 08:11:22 +0000 Received: by mail-pl1-x62a.google.com with SMTP id u18so1096250plb.3 for ; Wed, 01 Jun 2022 01:11:17 -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:mime-version :content-transfer-encoding; bh=xwQWkZi2pg7O8jKrGZkaBlu9bUDXqeDf9Lr3Nkf0Bv4=; b=bxANLQcj4jVmquv8Az4f04vsk+Dn42H+3pDj+SX0btmuN2EwwWXNVE7AJOyPni0KL3 Z1JrSTk5yfHuFuh8dKwQjxXhlVYPHAs0b4vHw05sHhfOYEgp/MVR5AOTuaJw5aRsBb4e RkYj5oqT+s1rODXRvtYWmFy7fEDmdlrz1UMfiT/F5tBgYr0cP64NQq6iigf913Tu1doN CfFhyHvSR1LjKWsY93W4IBf+lypbwW1GkZLAr3mQv63Gc4SOqdwPFYL0ESrGQ0kLS+q9 BK7xlwKfcGfN8FJzs3HfdQMFShJ85nY3nZxdzx1IEAmTW4JU/vHQLmqDqLmcGAVGTWVv g2iA== 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:mime-version :content-transfer-encoding; bh=xwQWkZi2pg7O8jKrGZkaBlu9bUDXqeDf9Lr3Nkf0Bv4=; b=BHVG3X2pAljo+elbAQwFnvr2l9uOUEXOkKz6OH54w+2lGlqlJtkCI1zupGOeUbHUUJ qAPI1Z9C69lbYFTQlPvFl2uk6s62Q3nRRwyGuZJ8Q2Yf8jwUb/89x+0KNt++FL7GjLBZ Q7rHGOZAX6DEXnFWRQ//3WhfT8mWfBwztUrrz4ElsekPXja6zBI4q9ihL/KlnJ0btBmb kTJCsapWJ96bBirJnAc/Ko5n94lvycGp2CbHsztd7FmUbp7S4IprdgOMcpmqmq7NJdlL C4Itaw7utMxJ4piFlJWZOG3lEtVNznu0QD2eSNUaTpxTxAn0qrPGWmnl5mgwVbjir8V9 sWxQ== X-Gm-Message-State: AOAM532MwM1zzr2klg7icWwAkjImGNR+Dh4NaiwrXXxx/qhRHRJdsEd1 k6lwgdYgzr6coiRNCO6BZ4A= X-Google-Smtp-Source: ABdhPJyqmMwhwES5MxkmWLZNvaPZUYEmVipycdBm9/b3biOPV1PQPFuI2+Oy8pX+m1Agg2yD1S+bfQ== X-Received: by 2002:a17:903:1c3:b0:166:303e:124a with SMTP id e3-20020a17090301c300b00166303e124amr569042plh.7.1654071077376; Wed, 01 Jun 2022 01:11:17 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 01:11:16 -0700 (PDT) From: Miaoqian Lin To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Thomas Gleixner , Marc Zyngier , Linus Walleij , Bert Vermeulen , Birger Koblitz , John Crispin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Miaoqian Lin Subject: [PATCH 0/6] irqchip: Fix some refcount leaks Date: Wed, 1 Jun 2022 12:09:24 +0400 Message-Id: <20220601080930.31005-1-linmq006@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_011120_668286_053D0822 X-CRM114-Status: GOOD ( 11.16 ) 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 The following patchset fix some refcount leak bugs in irqchip. The cause of the bugs are missing post handling of some APIs ——of_find_node_by_phandle(),of_find_matching_node_and_match(), of_get_child_by_name(). These APIs returns node pointer with refcount incremented. and should use of_node_put() to release it when not needed anymore. I've sent patch#1 and patch#2 separately before, I move them into one series for better management. the content of them don't change. related link: 1. patch#1: https://lore.kernel.org/r/20220526074348.23972-1-linmq006@gmail.com/ 2. patch#2: https://lore.kernel.org/r/20220517111710.37753-1-linmq006@gmail.com/ Miaoqian Lin (6): irqchip/gic/realview: Fix refcount leak in realview_gic_of_init irqchip/apple-aic: Fix refcount leak in build_fiq_affinity irqchip/apple-aic: Fix refcount leak in aic_of_ic_init irqchip/gic-v3: Fix error handling in gic_populate_ppi_partitions irqchip/gic-v3: Fix refcount leak in gic_populate_ppi_partitions irqchip/realtek-rtl: Fix refcount leak in map_interrupts drivers/irqchip/irq-apple-aic.c | 2 ++ drivers/irqchip/irq-gic-realview.c | 1 + drivers/irqchip/irq-gic-v3.c | 7 +++++-- drivers/irqchip/irq-realtek-rtl.c | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-)