From patchwork Mon Oct 24 11:30:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8452 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp402372wru; Mon, 24 Oct 2022 04:49:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4WYlcB9/p42+BNonexRQOrTPLLFTi29KwFTEw8O5cSOiTgq5nFJ/Mxez7is+voV2TzJ9Pb X-Received: by 2002:a63:2f82:0:b0:460:8786:5b91 with SMTP id v124-20020a632f82000000b0046087865b91mr27490788pgv.422.1666612197406; Mon, 24 Oct 2022 04:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666612197; cv=none; d=google.com; s=arc-20160816; b=BnE2/TqtQqHyrsBQkHZs/zMOUTXCXA+6SGhK18/lCADTbDVwP5QUm5vqvMJUGMOVkd ZK8N4u2m8BH+FLfeFoqzJiJZa9SgGJnelSwIF/LWfrG1QV43gSRbd7yFTPAUwXhJFP+m J9o1dZSU+qQL4Q38q+ZjdZARFpTTUOR6hZ3liuVSW8Cb0IHy2iG/+1sjvsSj/bi/PeNk MU9ayjgaDR+varaIhPTKxFl/jAn8O5l8BVrWkQtosr9wlZLG/4tEzgFi0u3tT4USiyKc WUkYZZBQJLNCBCJJnr+eWwoh73cq/TeyEupUAj+loRO2EOwopNjTXXTC+1pskONkRgtW biJA== 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=5ZM/ZrpkdtSNcoORYLl9WbpBg6kYER3zoaOdoC1GzUI=; b=rTIwS2Bq5JNRfxkMaXmIxQ8ITHq0P/tP9YrcAbJjuH9j+dxTFZDNAkM7/+VVjCr7sE 2fbhdENlVXInMml27KFO3gqz656Xqdpll/ivcqaMUPQSvycVQPBij2BlCV3s+CO2vFVm K5NyWJ8bTbgt1MzoAyUgf0f54OcTX+gZCv72OoPgtcxOEKXD3xr1eAtuPTJPOhC93Lpm OYRtNt/JuxI7UoYlfjjhSKKyCwqw6JyfkzWNL6Y2SC74ZlYdWRSrehHAljgrHIrmijm7 v+ldk693Dc7IjdsIbVT4Yff3qDHwgoWvSztxsEbxwThpF4qW97vT3QmPxc1Nki+1ujuQ eqUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uMKGRpnV; 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 u18-20020a170902e5d200b0016f1c879eacsi39938822plf.109.2022.10.24.04.49.44; Mon, 24 Oct 2022 04:49:57 -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=uMKGRpnV; 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 S231268AbiJXLsn (ORCPT + 99 others); Mon, 24 Oct 2022 07:48:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231601AbiJXLrw (ORCPT ); Mon, 24 Oct 2022 07:47:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87CD62E9EC; Mon, 24 Oct 2022 04:43:12 -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 1D89161277; Mon, 24 Oct 2022 11:42:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BE85C433C1; Mon, 24 Oct 2022 11:42:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611744; bh=gVRxCi6HdZ+Y2hyxhs77KDg41vKK92c+2may0MmZ35Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uMKGRpnVtoz3nyRzROiWLnIAoJgctFNNqNcRcKrrh2LJf8W+PRS1Ccs7kJwxxX3XN zZoPX7K7kkLDJzjZqHe5LdqxPA6T3U+PuORp2MyWKLrOIvBApXwCBTySaW2+GkL3MP zjxDYBj+ZFb1xhv/MItaemkKSxC7jLHY5AtcbzQk= 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.9 095/159] HSI: omap_ssi: Fix refcount leak in ssi_probe Date: Mon, 24 Oct 2022 13:30:49 +0200 Message-Id: <20221024112952.897460797@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@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?1747569551753274102?= X-GMAIL-MSGID: =?utf-8?q?1747569551753274102?= 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 22cd7169011d..56de30c25063 100644 --- a/drivers/hsi/controllers/omap_ssi_core.c +++ b/drivers/hsi/controllers/omap_ssi_core.c @@ -562,6 +562,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; } }