From patchwork Mon Oct 24 11:30:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9856 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp559170wru; Mon, 24 Oct 2022 10:06:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5BY9WEZeziZIH+f+WDorify4Hzij/tOG65dxeOvGMYysMccDDq0kySlycC2vNVSDlcmh6g X-Received: by 2002:a63:80c7:0:b0:46e:c7be:b56f with SMTP id j190-20020a6380c7000000b0046ec7beb56fmr13384743pgd.382.1666631161820; Mon, 24 Oct 2022 10:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666631161; cv=none; d=google.com; s=arc-20160816; b=xHzEDpPykMrrjUA1lbGKmqfERkWaMiTRtZ3fF7qSlFBPR0ZMe6ax/FwDo+ql9yF1dr v3EkMypkqgZ/ikBmGah86xttU8vAwo9NWsjqNfIDzyjvEv66pMEYiA/Jy8lZpB5RalVM YGWmfxFQfGGFPHaDgBNvDpqMPpKKKWH+WdWuzilVskeqkYNPZ0bvINNz2yJlQPOaTXUz u1k+zrUdRpcfljciOIf9RJC5fvTqn2IV1OlhDRavxXJQIdAb+rfa23LX6oVI+42xavbA nkZvt2qqhgbRHtyy13lpccx7IEnZg3K5/ZtCJgoLutUUYNfHK3BFwDy6Zm8kINTdPEdw LczQ== 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=MygECGpZxrjTPFOXjY3DcVfhnAFDCTsr1lJBGOWmg7o=; b=WfN3gVtiLJUmIGyXKcIz8jjAV2gb+To/s/Gn5YIv5k6YIHPCVC4VBuIf2wSQ81BuKW iG7mFfE3S+/NLhtbjX29vXfaPmJ8XJErzTArqyaoakVqm2Z4joCmV+HQlCzUcpfAIuTv QL9TR8AH4hwrp/2IOd4D5mak6yYkPO6OyXHmfNFMLV+UrOm6agd+vNXkFj7jM9t3WZ2L UzwpiY4mHfOE6icF0xHgNchU6y7r1jnHYBFd6rXr2FX9o5kKvWyvul5MokohRQfT+1vU yVzGKiof71J5chjms7z66Fomoo25b84swo2DRHXDtO8MFHpY4OYTNSF8JaRFGwhvBwBU /dmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B4ZFXv4l; 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 qe5-20020a17090b4f8500b00212e24a499csi535130pjb.26.2022.10.24.10.05.47; Mon, 24 Oct 2022 10:06:01 -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=B4ZFXv4l; 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 S233227AbiJXRCx (ORCPT + 99 others); Mon, 24 Oct 2022 13:02:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233538AbiJXRCX (ORCPT ); Mon, 24 Oct 2022 13:02:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4E38160852; Mon, 24 Oct 2022 08:38:57 -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 ams.source.kernel.org (Postfix) with ESMTPS id 1B905B81204; Mon, 24 Oct 2022 12:00:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78D25C433C1; Mon, 24 Oct 2022 12:00:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612803; bh=p9732RSsGgZuE0sVRNVEJIAFnxTmYtgxzpoRqKThgks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B4ZFXv4l6qP/CqSXW0KWC1Lp4Dtk7/1A24vWMCay2ybyQg4bS6k8rItTt7vzeVMGQ w6HXwr218B1O20XRN3fB0/DVwRIB9SZHSq0+2w+BlVsX9jAuCK23T4QZIWyhFC/01H 3La/j/WzdcNir0mCIFMduPUW0RPb4qk3wk/clAiQ= 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.19 126/229] HSI: omap_ssi: Fix refcount leak in ssi_probe Date: Mon, 24 Oct 2022 13:30:45 +0200 Message-Id: <20221024113003.079294681@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@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?1747589436800642892?= X-GMAIL-MSGID: =?utf-8?q?1747589436800642892?= 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 129c5e6bc654..15ecc4bc8de6 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; } }