From patchwork Mon Jan 2 08:24:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaoqian Lin X-Patchwork-Id: 38027 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4067048wrt; Mon, 2 Jan 2023 00:29:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXveWF6WpnRR7jntEXDM8rsAxrOHOR5cDnhYPJJMEcO7F+51pmkagPWYZAY44BEliOLDpVEC X-Received: by 2002:a17:906:c192:b0:7c1:6fe:f4a2 with SMTP id g18-20020a170906c19200b007c106fef4a2mr34883419ejz.45.1672648180780; Mon, 02 Jan 2023 00:29:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672648180; cv=none; d=google.com; s=arc-20160816; b=wfDJadwuMnAB30oy5SU+fMPLXufC+bqtMcnav1tl1TqhtU1sH3UEQQF0vyTNNFJw91 K/QvTz3PghppgJSUYExaXKaOeS1J45CFPxHwjCRlvxMidR5BTS5WXwocLtUGOSu9kNkg tPmW6/ifucUtW5CXPwYVGnXFllQEwtkUx9GZ5S2lcKEBimR56qvDylezMCdhxhgVtJc2 /8Xny9yGaquEF3JaDNzQ4uI/WepXawGMqTEU1cz2pcJx69xpm533wialwUwI6e/si0sw 8wzdmqd6VsDRcYujXLBMNBnMcx41CnYP63d3H/Dnpq3Bdik0EtTOI8EneWLMQvQd4fwp wNVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=93nJ5Kz+BlIZ58Rw+CqZdrGFJhp2grdsPUR6i1eSHYg=; b=vLlovjb/wdSc3/GQJBpVnoPod2QI0aXZHuhalEWweRASBOQefLD8N3cSqlMiFTQoLh HKYRIsyAzmovGfLWiirc4iKPtXzzOnQBcjwCffECQP+jvOcrCMi1dTpAQT6ELp6s3ghU yykaYcT/H0gCSJTwgSQa2NgPx3Fgwm3OYL4oyXk35Rsh/4/4AteTUiDZyBRSfIvkB0QY k2qDaBq4ZO188P6xGep2Z3yCrnfnLGa497agPouCNvFQqJYeopEx2NYTwrzm7/fOo/IY mZRCu8wACTV1CoCx0Y0k5dB5RCd4CDVWxFJU3P/L6YUxsrLajTosUM2Qe1XeuSEsHGHL 02Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ELMrLaaN; 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=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s2-20020a17090699c200b0084c4399a502si19663577ejn.893.2023.01.02.00.29.15; Mon, 02 Jan 2023 00:29:40 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=ELMrLaaN; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231653AbjABIZZ (ORCPT + 99 others); Mon, 2 Jan 2023 03:25:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231658AbjABIZR (ORCPT ); Mon, 2 Jan 2023 03:25:17 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41C2B106; Mon, 2 Jan 2023 00:25:14 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id n4so28973650plp.1; Mon, 02 Jan 2023 00:25:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=93nJ5Kz+BlIZ58Rw+CqZdrGFJhp2grdsPUR6i1eSHYg=; b=ELMrLaaNHYA60UyumkyNKPmpsHkbWZ1wp0uePUanFKJQMdmeuiPk8xrbSiw9Qv+LWD QpUGYakUN5IK62N8/Zugfgf2L61dVoVqkkp8ThHB8wAIqNZhArKbsOYJN5z0GRuzhLMv MUhhXPtAAppVWP9S9sfHMghKNjcNpXb0zsOV58owX6YhEkudX4UgXdB5EqS10aFMU55A EQFGS8qS7KDxfZY08122Bw6jNZ9mWxl4I8Yo+iTRFCdFuTVTHpZaoRTkzj8vg0ZN+9h/ QyZ7Nc2/Ifub3QekUxhDpyY8OXWu2M/WM88M9z3pFwKMGp5pIfi6KcMX25Qc1CvEAEwN WjJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=93nJ5Kz+BlIZ58Rw+CqZdrGFJhp2grdsPUR6i1eSHYg=; b=NFv7+Riv2cSmCMgf8G40VEx0juZE6BLSifCvwcpIgYCslVzlrKckyVkQg7VuNU/zBS hX1dWmvwmMfnpvZVoLHQNDEOAohnMdcBw52FkfLVd8nOrayUL8or0kdODJsm1u8fWGJS 3tJO6kuhXb2ov90xJl7vq64TTLytpbtnLR7pS6A7hl0GMAb5WHCiA5frR20REicxuawS MxOhrWiw+80ApiNvM6d0dmj/+oH/vOARNzv4sriXg3kGVdwLO89GCYxGX86O68ovAeGj IBvWEUSlfmISg5D24atKmf8IjYEbu9hDDFhsKW0wUI/mISxd6R27H7EkKAS3MxOMuPQP CmBA== X-Gm-Message-State: AFqh2kpF6jLtB178fhy6YfxB1zwwL5YTCqS/9ce1i4e1pFw5KF6w8nfg n8lpqFFcT3kH6BTv6FwOVXo= X-Received: by 2002:a17:90a:ebc6:b0:226:5900:f2f4 with SMTP id cf6-20020a17090aebc600b002265900f2f4mr8244054pjb.4.1672647913766; Mon, 02 Jan 2023 00:25:13 -0800 (PST) Received: from localhost.localdomain ([202.120.234.246]) by smtp.googlemail.com with ESMTPSA id lr4-20020a17090b4b8400b001fde655225fsm11431028pjb.2.2023.01.02.00.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 00:25:13 -0800 (PST) From: Miaoqian Lin To: Linus Walleij , Maxime Coquelin , Alexandre Torgue , Fabien Dessenne , Andy Shevchenko , Marek Vasut , Miaoqian Lin , linux-gpio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: stm32: Fix refcount leak in stm32_pctrl_get_irq_domain Date: Mon, 2 Jan 2023 12:24:56 +0400 Message-Id: <20230102082503.3944927-1-linmq006@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753898739296155404?= X-GMAIL-MSGID: =?utf-8?q?1753898739296155404?= of_irq_find_parent() returns a node pointer with refcount incremented, We should use of_node_put() on it when not needed anymore. Add missing of_node_put() to avoid refcount leak. Fixes: d86f4d71e42a ("pinctrl: stm32: check irq controller availability at probe") Signed-off-by: Miaoqian Lin --- drivers/pinctrl/stm32/pinctrl-stm32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c index 1cddca506ad7..cb33a23ab0c1 100644 --- a/drivers/pinctrl/stm32/pinctrl-stm32.c +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c @@ -1382,6 +1382,7 @@ static struct irq_domain *stm32_pctrl_get_irq_domain(struct platform_device *pde return ERR_PTR(-ENXIO); domain = irq_find_host(parent); + of_node_put(parent); if (!domain) /* domain not registered yet */ return ERR_PTR(-EPROBE_DEFER);