From patchwork Wed Oct 19 08:27:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5303 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp282944wrs; Wed, 19 Oct 2022 05:03:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5YpHAwY0r69E00qca8PnoGKxfOHvbX5rYQpjFfm+s25ehFvJFByXx0v1rDqTCBwMjrlCS0 X-Received: by 2002:a17:902:bd46:b0:17e:8ee5:7b61 with SMTP id b6-20020a170902bd4600b0017e8ee57b61mr8354497plx.44.1666181034780; Wed, 19 Oct 2022 05:03:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666181034; cv=none; d=google.com; s=arc-20160816; b=NN0JpgcTLSDD83UpEIze6X7SlHsjg2qRy3RspIK9crqCvdBJgCrEDGX2qRK6mTDW52 QhQ1Sa+i1LIeu3ozaxMLaqdMZza8bJZ4ItAtnxGWrxoRsG0ZSA7u99BQ06ZT8eS/OEiX zNizX5N3uRlXfgnHswmQ3HY4hG5ffrlIKYUjIKPM+me72H/8PUEYFOxy6TFLtHBwe3UX cqVwqnT04AWIQmRwhATSDQBN1t8vKasS4DIcq13uuoEF6FSJOCo8vVsMNIzaVSTmJADu P2ypEzSckTau4jIrdjKFeOXjcV5KdENbOXBnIeHmOflT3CyzgYMskxh7LHXUI6eXIXjF jahQ== 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=MziyT5vg+H67whEHrQd9zuEHgG49Q9pMI1vq7fFIVYg=; b=Geivz/Sv8pAi2nDbR2C+cXP02kan90FFSbzDyNW4HJfdm2KAwpGiSjMHhvC9dQYJFD coNFjIE+C9C+eMzBqS24B+wE/pF2OgWfYi6zASmn/g1qi7xxkEvaCoejzcN0/P/jigjJ OLOWUp7zEpWkoX1/PtUt3NcZfiT/0dJvFDkz6el6r/uaPOGou3yWMhoCuxR/7znaskTe xP/n+y481FSADilmzcqXQEuWSBu5LXBz4zguKUblFsFE7CHpxiBOqiFn7hJrzxy2X8hK EO2pWjgkwM3OYNXRfu8c9q4HGQb+FFTEVufe9IQNSQqb77cLlINCqvqjf5UCM7W2DrpF JIUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IxRqG3Ag; 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 k12-20020a170902d58c00b0017d2bb81273si18143155plh.600.2022.10.19.05.03.40; Wed, 19 Oct 2022 05:03: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=IxRqG3Ag; 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 S232387AbiJSMAj (ORCPT + 99 others); Wed, 19 Oct 2022 08:00:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231989AbiJSL7c (ORCPT ); Wed, 19 Oct 2022 07:59:32 -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 185A0181C99; Wed, 19 Oct 2022 04:37:29 -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 CE73AB823C0; Wed, 19 Oct 2022 08:54:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48E8CC433C1; Wed, 19 Oct 2022 08:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169645; bh=GcEtVsWKnpmNwwgXJ7eWwXOSgwnZJUIhbPIQKSK6ZAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IxRqG3Ag8oO8yLR8KjzoEmSKE6gmd8kPAJVYNGeL9bRMGOH44KtcKw4mu3dtXba0d qQCVsYoaiEwyi1RXF3dL4voRzIb6tslXxpNlWevynQkes77uAuGQ1SM4OAvgQnnyGF 3Rhokjuzk2smQ5qBk5m90Zgbop1NJKaf3n7SPJI4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Robert Foss , Sasha Levin Subject: [PATCH 6.0 355/862] drm/bridge: tc358767: Add of_node_put() when breaking out of loop Date: Wed, 19 Oct 2022 10:27:22 +0200 Message-Id: <20221019083305.720386538@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747117444430287028?= X-GMAIL-MSGID: =?utf-8?q?1747117444430287028?= From: Liang He [ Upstream commit 14e7157afb055248ed34901fcd6fbf54201cfea1 ] In tc_probe_bridge_endpoint(), we should call of_node_put() when breaking out of the for_each_endpoint_of_node() which will automatically increase and decrease the refcount. Fixes: 71f7d9c03118 ("drm/bridge: tc358767: Detect bridge mode from connected endpoints in DT") Signed-off-by: Liang He Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220719065447.1080817-2-windhl@126.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/tc358767.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 02bd757a8987..1dc107f13645 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -2010,9 +2010,10 @@ static int tc_probe_bridge_endpoint(struct tc_data *tc) for_each_endpoint_of_node(dev->of_node, node) { of_graph_parse_endpoint(node, &endpoint); - if (endpoint.port > 2) + if (endpoint.port > 2) { + of_node_put(node); return -EINVAL; - + } mode |= BIT(endpoint.port); }