From patchwork Mon Oct 24 11:30:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10281 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp652902wru; Mon, 24 Oct 2022 14:08:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7b9nr6dGnFR4mvdCESy2RDIkpm+xJFwR3BtCf/OpG6nXBDbF7PUL8VRVOX047ikjY3bHUk X-Received: by 2002:a17:907:3ea9:b0:78d:fdf0:88fe with SMTP id hs41-20020a1709073ea900b0078dfdf088femr30471348ejc.667.1666645718269; Mon, 24 Oct 2022 14:08:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666645718; cv=none; d=google.com; s=arc-20160816; b=fcRTTBa1V01O2V2elE0Owgdw3ZhTnRBaCTP+uRMWtBVmsBbMXA7onzEdn93xWYddsi YstBXRELf3ewc+vpfAP61YtqwmkCMe6o02OOAwET13sETzt+8RkSYWzPmc79hpt7CxmC XBUr2yE7uHAhNzIED6V+XPtupzuWpf4q47/6WonyqulPJ0ScOYBzCBSPPLBMWfi4SJkO yIZmPSlm1a/i+zgMgT/ZASbhSrwVLMugdxOj3iSp2sGEaGltj2uWbfeVBCnKXfgLqmSl 1U4mGdArNWungyVy91zBA5wi6PddaVtWhEZlykHj965YYc2J7UFDX27XaR7iuhHCGZ8r Zw9g== 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=SzCoMzXFyE5GZ0NQm10hPs0HXA7uc3zrgWOO6r/lAuA=; b=A5kPfcnmp71Z912JRXAEsPalU8tJycz1kOwryGMb4lgim3rQg1ZkWvGvbG6nGTQ4rv Iit/uh59lMWSt468vehLSLltnqQbVfHhKQq1rJkmMYbm/R7Hliir531xk1RT6Hfh4k2S m0N9erVJ+NkHRXb4tUZQ9kHQGXKqyL90hcb1+xFCevKeJtEDoCLxcNAMDgqQ8gaIWt3K eahNbm5bjCBDSYFceC0qbIbt6MeRiDnsDQGI3yTdYHmaFxS6Lc2DDeD55ZUTGQhpWRnv 69iBPcQpICa94ueM1rJz/bAwiH0A1hii6I0WbiNFUW96AIvqfonFXNlgb4P/80+IUF8U uu6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H90afxO+; 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 r11-20020a50aacb000000b00458ab55ccc9si739807edc.168.2022.10.24.14.08.09; Mon, 24 Oct 2022 14:08:38 -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=H90afxO+; 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 S233756AbiJXUrP (ORCPT + 99 others); Mon, 24 Oct 2022 16:47:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235154AbiJXUqe (ORCPT ); Mon, 24 Oct 2022 16:46:34 -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 9B45A1D0C7; Mon, 24 Oct 2022 11:54:21 -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 61C3761295; Mon, 24 Oct 2022 12:11:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 746BFC433D7; Mon, 24 Oct 2022 12:11:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613497; bh=oYcz0CeD1bLDLIcWSYmweAHkK+Sk99SWfYn/Sl9KipI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H90afxO+F/yU06bm8N2Y6M4tnJIVKxmsAAf4SXYx9n+dMp4nfKBWk6UX3S4xBFNLg 1LTQ3Y7pCJO9AektYgs/rJXSr4y9CEu1IKqfI0CPqN+B4/ZDONkf5MKw/CFK7u5Chj AWrKabGKB7uGCAS3yBqAz/bLpq1ITUtCXZRuJWWg= 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.4 129/255] HSI: omap_ssi: Fix refcount leak in ssi_probe Date: Mon, 24 Oct 2022 13:30:39 +0200 Message-Id: <20221024113006.859257762@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747604700725785779?= X-GMAIL-MSGID: =?utf-8?q?1747604700725785779?= 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 f36036be7f03..5aa6955b609f 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; } }