From patchwork Mon Oct 24 11:30:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9101 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp456054wru; Mon, 24 Oct 2022 06:33:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4W75uWWrgZDUbhO0P3X0uSRXSa9QuGB5EYXrdrxSru3fatVGXhqWPzxRZKMjxjn5KucDBu X-Received: by 2002:a63:4a41:0:b0:452:bab5:156a with SMTP id j1-20020a634a41000000b00452bab5156amr28315241pgl.486.1666618409975; Mon, 24 Oct 2022 06:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618409; cv=none; d=google.com; s=arc-20160816; b=lowSh4hpIFadbreOt1S5exHYG55fFLHxUK7RhMoWKgH+x8p4nyjP+2n6G0E2iF327g BPZyMDjEnGCgg9Jk+kYIRqKYOI95dkqed6eizItEqORQRLqzRmI15lw4rLYGkZyWXpMa ep5cJFKl5kmq1YqcpDjUjqDJl4McDypuNhKbXxFGg+fdZQCfdMLWo9qyG1sMqU8ElO/R CT2ywSB67TunkLqsaq0E2rtIe//1BG30bl2Ndk94PadRkbeJD08lSZTp5s13Z9PPm9bj 4lhXGXYSZTditlPa+Kl5EuXgkGFfb3TdZpAOP7IqvxUSHnohE/ldi8zUVABgvnpWmb9h h5UA== 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=VGRPIeeIqsZGJ09oHuM2Tro7INBQkONxe9XWD9Iq/6ZT8H30XIac63A5bdpGowy8D4 U6aDL54N5Hej+z0uQUsTDs33Hi0dwAkF2djSGLt0CkgWysmSUoZ54FUZ6gsnVf/R/BFx hOI8NMlFMQ6Rvl8WOxMjdU8RAuyL+yxaPXpl7MkVUH12itIydbRD2NTAn+CqxGoySDY8 CFj3XVPiDnL3FYQjRDBvFJIgVyMuH//PsIo1Gw3BmymxWF8nAFIad1mqlCLJuHolIOeS lBtreBpWXZ08mrS6jOJcMqMQsrcaHyaatOY6iEtc0qckxr82J2Lwf4eS9SIXbA2dPyqi EX5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ghy5+okF; 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 b13-20020a056a000ccd00b00536fa6bbb11si36605136pfv.344.2022.10.24.06.33.14; Mon, 24 Oct 2022 06:33:29 -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=Ghy5+okF; 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 S235864AbiJXNQQ (ORCPT + 99 others); Mon, 24 Oct 2022 09:16:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236073AbiJXNOj (ORCPT ); Mon, 24 Oct 2022 09:14:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 936239AFCC; Mon, 24 Oct 2022 05:25:31 -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 63681612A1; Mon, 24 Oct 2022 12:24:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76875C433C1; Mon, 24 Oct 2022 12:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614289; bh=9+NtXeXBvF4Ebv92J6wPhWRQ5nQ9JXpxZQzq7UfEEhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ghy5+okFY+dduo6exq/tztphZ0q11IeYjVtoYArDW4jq1JfP2+sU5n7hq1BtAF+7S DFgQS1ChGrQeDRxUm6poIAh12l+aw5pnuM/ntzeFSFFEZyK4+osVF31C7qgzUBp69f +Hu/dcGp/8PivLTPpoEfWLOOtOaZxZ+bbtZl33F8= 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.10 204/390] HSI: omap_ssi: Fix refcount leak in ssi_probe Date: Mon, 24 Oct 2022 13:30:01 +0200 Message-Id: <20221024113031.440807604@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747576065342065486?= X-GMAIL-MSGID: =?utf-8?q?1747576065342065486?= 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; } }