Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3120815rwb; Mon, 15 Aug 2022 18:37:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR7VPnvWsUkmUNi37Osq4de/aB3vbj2kflUg0vN6aoGsyJp9tlo/zj9wOOnGvRkFec8iFOks X-Received: by 2002:a17:90b:198a:b0:1f5:2f97:12a0 with SMTP id mv10-20020a17090b198a00b001f52f9712a0mr20239203pjb.97.1660613863493; Mon, 15 Aug 2022 18:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613863; cv=none; d=google.com; s=arc-20160816; b=ugB5hokpc9JFMrxKLYC7QqpwYOhfq7Jmr/6PZ03AGV0Gm4nV95yRNpr10KN9r5RAz3 bGlbtxwMmnpkYwixckqyD1uXVoDw/xHH4oQEsHWhFPO75nihIxuXM6oa1C9JMmEF2J9b AdQRDzYjDuCbQ9DeaAWvqvTAoicZtf5GPxTikCRv7wBQK3RFuM9S4cR9wIw7VR7LB6C0 BVPcwJ346Uwyzi5vsuqGYWfiGDAk4LXSu4OLIrKoehE/7jyp4fXas2ENiDaK5u6Lhs25 58p3MvtDXsvbNRC+l0CQPtMG0CTH3uIH1mllmz7myKXc+8kyBZMig6vnROKfFdtOQSdb 5uUg== 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=Nz/JxdBoDSfkYx5asgxLXO3hMk1Lo6GXNqvgoj9JWD8=; b=07flw3lKkjDpHORvcUY/6MdxXTA4wm6hXFUACGBViy10WBk9+N8ETnys3IzYKdjAue Pd3gvWT3RT17LioUuJaLOh9yZJIKVxikN/KT22DDyG7v0k8dweiFH7+prODRd6Va2J8S UzDAATO8eqPhYsS5umxZNvzaIWjr10Gb/OATPAIfNL0P4pD7BJV+A0mUb21mitWBiGzC boc9Ik5JvwRmZNyd7N8NQ1eKbq4vjs3nvDvuHfAWE7IGap5cKot59DU004GHWWCrO5Mc ElLTLwEgYxQfXaerC7k/bfWPJV0MDCQZeZYCcD1CXHpX29Q9HUkIlV84QbEHWeeO3zZa r+7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m4VsTexA; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s34-20020a635262000000b00419dc0c2d71si12217230pgl.115.2022.08.15.18.37.32; Mon, 15 Aug 2022 18:37:43 -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=m4VsTexA; 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 S1354065AbiHOXnB (ORCPT + 99 others); Mon, 15 Aug 2022 19:43:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354056AbiHOXlE (ORCPT ); Mon, 15 Aug 2022 19:41:04 -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 28D3C98A4E; Mon, 15 Aug 2022 13:10:24 -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 92F4460025; Mon, 15 Aug 2022 20:10:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96A25C433D6; Mon, 15 Aug 2022 20:10:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594223; bh=AZdgHdd7Lzfg2eg8h8WDpyyCu/wK8MepgvhUm1bY0G8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m4VsTexA1LwbA/pgQjnE02bqlDUQ/Tcvr7a7HhjpbM6XipFMmRiNA2dhttD4t3FMc chjzbmHtfviw+uXTSM7bnhjTNu8VPUd7CkmsV6/Oxn+r3FaTyEVXcwL5f/twyJE+AL jlM3iH7JBxYib4acx3jfgJrZkWUjz2oN/q4s4LyI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Linus Walleij , Sasha Levin Subject: [PATCH 5.19 0397/1157] drm/mcde: Fix refcount leak in mcde_dsi_bind Date: Mon, 15 Aug 2022 19:55:53 +0200 Message-Id: <20220815180455.551387286@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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 From: Miaoqian Lin [ Upstream commit 3a149169e4a2f9127022fec6ef5d71b4e804b3b9 ] Every iteration of for_each_available_child_of_node() decrements the reference counter of the previous node. There is no decrement when break out from the loop and results in refcount leak. Add missing of_node_put() to fix this. Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE") Signed-off-by: Miaoqian Lin Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220525115411.65455-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/mcde/mcde_dsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index 5651734ce977..9f9ac8699310 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -1111,6 +1111,7 @@ static int mcde_dsi_bind(struct device *dev, struct device *master, bridge = of_drm_find_bridge(child); if (!bridge) { dev_err(dev, "failed to find bridge\n"); + of_node_put(child); return -EINVAL; } } -- 2.35.1