From nobody Tue Dec 16 16:37:42 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F1D2C32773 for ; Fri, 19 Aug 2022 16:11:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351778AbiHSQKe (ORCPT ); Fri, 19 Aug 2022 12:10:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351459AbiHSQHo (ORCPT ); Fri, 19 Aug 2022 12:07:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B96F10E7B3; Fri, 19 Aug 2022 08:56:19 -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 CE2CF614DA; Fri, 19 Aug 2022 15:56:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC09EC433C1; Fri, 19 Aug 2022 15:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924578; bh=YQduwSTiQg41hg0PepeKUrWVaNK157UtIZtmCjpbLAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fAdFP6ghxLT5om2jfQHvlHcQ4Uw1ne0o37NWwMGhc2V1smESV+U+dqfAtXegOAjzu DoIIlSD7FIU3xnQk8Ee8mi2jv5QRU/odCZo7o55QYKk5qZeWbMwmqkRg3/BwC+2UUr T2Pt6gjqOhKKnJ9sXUs8e5OlvpZR1ubgrtwAoqds= 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.10 185/545] drm/mcde: Fix refcount leak in mcde_dsi_bind Date: Fri, 19 Aug 2022 17:39:15 +0200 Message-Id: <20220819153837.644832936@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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_ds= i.c index 5275b2723293..64e6fb806290 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -1118,6 +1118,7 @@ static int mcde_dsi_bind(struct device *dev, struct d= evice *master, bridge =3D of_drm_find_bridge(child); if (!bridge) { dev_err(dev, "failed to find bridge\n"); + of_node_put(child); return -EINVAL; } } --=20 2.35.1