From patchwork Mon Oct 24 11:30:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8587 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp419218wru; Mon, 24 Oct 2022 05:15:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7U6dO1Vz8BZdfcPLnFXkaLTo/ihsp0I2g2nTTV9i0joXGL7gxy4Xk82ceTQNpHsPYCzeOp X-Received: by 2002:a17:906:dc8f:b0:7a5:8160:1995 with SMTP id cs15-20020a170906dc8f00b007a581601995mr6319210ejc.500.1666613754494; Mon, 24 Oct 2022 05:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666613754; cv=none; d=google.com; s=arc-20160816; b=DsnS60wUNKNyvOO2pZYAXK1OerPL4KLyzTP0lJNr1rin2m/kmS0GkO2FUbDjnTOYfs y7xKaRdOXzV7Xnr+tMfHNTSBNITFc9kJpWlrzlvyCBZ6XKedPWbPfspgaFDeUh6t1a3A jMAKernb4oLnymfH1R9tc6pySgvf9Sn9ey6TY0E/D5Rw6eQ1hBEc1W+S+eR/E3YTbowy e+omzXf+YBJLCBcpf/Poay2VDwGjqlNlG8gCxLJc+fkZgXMXGQp7IyccDYHEch4nKY4j K9ew/33y604T9IWCaCgjejYRM/2XyO+7V1JgQ+V39SNF8RO+uXpebTWGk2AxJ7d21OCh qNqQ== 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=tPRJPNA1iDsjwvA49KAi5VsVjqSNe5SRgDtKtbBlO/E=; b=Ahd1rPeAbR1WiGf2JZSe19UTrG0DYXn7wbpLL/IU9CP8TRXjnAYDnwI1Ilccvqyur0 YXsqUa6ND11VQuPsw6cU21aNQQQURQ4onPteAMyDEf2b6/4XOqW0ADx5pSuOy4OQsbhh M+oncr3PSwwt2ZUn2/0jEeIjiT5fKezQxQGpLEmgTWxemaeru7Gb2ZeucRUJVxZxFNhh dQ8nP0c1BKkG/p9NrmTIfERl0NnutD/ZexmpCrIBHA9iYrc5kp5K7RbEi1GMpmk5Qjgs /P4z4g5n1krGwG24AkqCEnPNqSOIlkJMdxcpVDi764/MOfVIhsd3R9Xk6+S0LdvBepgs A5gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CP319DYX; 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 fj2-20020a1709069c8200b007aa35038c6bsi1303202ejc.463.2022.10.24.05.15.30; Mon, 24 Oct 2022 05:15:54 -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=CP319DYX; 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 S229631AbiJXMHC (ORCPT + 99 others); Mon, 24 Oct 2022 08:07:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232915AbiJXMEh (ORCPT ); Mon, 24 Oct 2022 08:04:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A81ED73; Mon, 24 Oct 2022 04:50:49 -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 82626612B2; Mon, 24 Oct 2022 11:50:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96674C433D7; Mon, 24 Oct 2022 11:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612237; bh=CW8gk3mYFvAel/RUsGWu75S5tMb8UzsMZGE5o3hFPAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CP319DYXqlbPd4IGdPVTvW3rY6rEiiQ0ARfl0m9Tp7nFHewtGU6PJIysqu+TFb2+o 6cDgouG6chlRvRhd4kkKLDvBrpHC/LlxOwlvZrLd+XyVnZ0FvLPhGxT5aBsD+SXWCZ 9M/hLnL5k5WwkVh844f7Lh+/HiakcKcmsA8hvOTw= 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 4.14 121/210] HSI: omap_ssi: Fix refcount leak in ssi_probe Date: Mon, 24 Oct 2022 13:30:38 +0200 Message-Id: <20221024113000.907205001@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747571184284247012?= X-GMAIL-MSGID: =?utf-8?q?1747571184284247012?= 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 3554443a609c..6e9d88d9d471 100644 --- a/drivers/hsi/controllers/omap_ssi_core.c +++ b/drivers/hsi/controllers/omap_ssi_core.c @@ -560,6 +560,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; } }