From patchwork Sat Oct 22 07:24:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7625 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1107499wrr; Sat, 22 Oct 2022 01:41:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5X8/Z4np8A9VYFJgnGao6owMu5WWzBc+3ZET66ce3422oOAsuIlNMkMvDm6ClrxSblk3xE X-Received: by 2002:aa7:c054:0:b0:453:98c6:f6c4 with SMTP id k20-20020aa7c054000000b0045398c6f6c4mr21141568edo.2.1666428066750; Sat, 22 Oct 2022 01:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666428066; cv=none; d=google.com; s=arc-20160816; b=KXmZu+3CgwiDdUnvjLHIaOoVJ9y4pBlP2AuKiJX3+4IIPbIKNH+hOWKdzYzgA1AGKd 02eCCRhr5G5KsPN92ebvtwKz0JJTOt/AEDhYHnfEc3zY7hglO7dEL+azONbGEwjj58qw MzgC90uMUSB/W3wJ2qfhljbOzijcbzejtdfnZC30dJGLq3pxv4G9kWLn10fxg3SveBYX AdeC8DJMC+0QLoegVs1A3Au3GrC9ukwj6ydol9D421NdXiwR4+ywzGvHgSUTBx84TH2q cHdapmwE391JkpF1bQMrm/iS8Ewdo+NZcgLOdzysKl/gkeSI8S66tHe3Pjzs5dxnZP+j tM2Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lmx/nv93+kUb6SouQSoeHr3oc8jzJ7zazO2KrXqcVXI=; b=tHWvjgWZyFFyfwvwOTHwcQ/OmAlBbkZoClxiYsoNj6sB2nOKIHF+iAfmFmth9yKqYw oGLu4bbqwAHGSFfq9LbHCH5yfICyipUj6Oub5rqRNqYnFJeVqUp63yWrUEJArV9wsNf1 glGb9AoEB569pCNS2WXjm9FLg2NVn1G6jiSPW4DttC4cKuh1mKQ2L3MHMN93au+QknpA 3tcf/VLsu2vrfBr4a4mu2c+UqRl1dnEzu65P4oTwKL2YO/AghInixBGbyzIl1yvgjfij jhMTJG3kDT56EE/GnjH9kqYKw4NoLCx1VbGpa7Uc+COqm8y2mctfZXI6IB3yH+Eqms/t blxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=se8kFrR+; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di17-20020a170906731100b0078d8f2658e3si24375867ejc.833.2022.10.22.01.40.38; Sat, 22 Oct 2022 01:41:06 -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=@linuxfoundation.org header.s=korg header.b=se8kFrR+; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234400AbiJVIhw (ORCPT + 99 others); Sat, 22 Oct 2022 04:37:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233975AbiJVIcB (ORCPT ); Sat, 22 Oct 2022 04:32:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC9412D1291; Sat, 22 Oct 2022 01:03:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ACC8060B85; Sat, 22 Oct 2022 07:52:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0833C433D6; Sat, 22 Oct 2022 07:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425126; bh=9+NtXeXBvF4Ebv92J6wPhWRQ5nQ9JXpxZQzq7UfEEhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=se8kFrR+Tnb7m4fGuv5BJN8cheUgpttA7SYT6+ZySAkSRSeu2624WBO0KjE0Y7I0s gn+zZ2cTQd0Sz+yHm95PRaoxfyFIZrH1WjEf1PmU/p9wvJieEefJbZnaopYcj6QX7A /kp9GI/PMrl4KPDtadB8MxJg19CpuqZjvDHlnG00= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Sebastian Reichel , Sasha Levin Subject: [PATCH 5.19 391/717] HSI: omap_ssi: Fix refcount leak in ssi_probe Date: Sat, 22 Oct 2022 09:24:30 +0200 Message-Id: <20221022072514.915402050@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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?1747376476458364815?= X-GMAIL-MSGID: =?utf-8?q?1747376476458364815?= From: Miaoqian Lin [ Upstream commit 9a2ea132df860177b33c9fd421b26c4e9a0a9396 ] When returning or breaking early from a for_each_available_child_of_node() loop, we need to explicitly call of_node_put() on the child node to possibly release the node. Fixes: b209e047bc74 ("HSI: Introduce OMAP SSI driver") Signed-off-by: Miaoqian Lin Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/hsi/controllers/omap_ssi_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controllers/omap_ssi_core.c index 44a3f5660c10..eb9820158318 100644 --- a/drivers/hsi/controllers/omap_ssi_core.c +++ b/drivers/hsi/controllers/omap_ssi_core.c @@ -524,6 +524,7 @@ static int ssi_probe(struct platform_device *pd) if (!childpdev) { err = -ENODEV; dev_err(&pd->dev, "failed to create ssi controller port\n"); + of_node_put(child); goto out3; } }