Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1863719rwb; Fri, 19 Aug 2022 10:38:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ZqbOSX/5wQasj0HEX9P4xjDSBuTkexqr4n8RNPSPcNaaP/+RDYYM9TTaM++X4AhVNZd2Z X-Received: by 2002:a17:90b:4c8d:b0:1f5:29ef:4a36 with SMTP id my13-20020a17090b4c8d00b001f529ef4a36mr9732769pjb.127.1660930721503; Fri, 19 Aug 2022 10:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930721; cv=none; d=google.com; s=arc-20160816; b=ewjJibf0f0+Zhf//cRwW2lrZBlQmHHIBtxBFIXQjpOOTPLvVC+UFCgrMbAzslUdzF/ a0t6PalVqtjo78v0wRxLvzfSgFA1CnrxA/52cLoq2/MkM56Zu1GspptcowhtxKdaOKsx bUwGI7pT/ytuk0iRfQIxs0Ywzo04KLbAyO1uuF2xD/QP1nXT7nkIi2jTY7WA/J1R9LE/ 7O8+oNSTpFqXRbzWeSW0r8i1jUSXNoHDNnUCNoPDwdOLVqkUs58smUDq173hnK0aJOdr OnD6t9Da/ixGWuxA23hrFnNG7ncVSf/BLrhdFb0Y9+uHDQyRo+O69yHC60IDnIUXNmm1 9gbw== 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=MpaSwdNy+764gDbKckF8ohsJWy/owXMqRe9oDrl3WCs=; b=ALBmZbtXsvCOjHdNAs23S2+kw8CeIY0/h8iVoGpPD/6XR47HxFX/i2dvc44ZOdH5Tz QTyGA5DzMnAi7lZlPfViAukaBlKNUn5aVG8OJGDiAEv9IEoVbW6njL+Ao238MJfyxKfE jZPAglN4SR6wSguPxZ03J7LyXBKXTFzwPuTaSVYuO1NSrNmRLAg30R3zNq5KwlXTVUKd smKg2MWM2z9IuwndITaTLis66iRnAeMfGJ+OZ2219heh9jshGny/hEMnq8Ck7K+SxPK2 amx3dAOrSFsAjMX3kFuD1bw4t3CwMLIvcXJ92iAqmR7V6aCDc9PhwKrB85T7kj/4PwgE OguA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fAdFP6gh; 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 o8-20020a17090aeb8800b001f738b7987bsi6749376pjy.22.2022.08.19.10.38.31; Fri, 19 Aug 2022 10:38:41 -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=fAdFP6gh; 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 S1351773AbiHSQKc (ORCPT + 99 others); Fri, 19 Aug 2022 12:10:32 -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-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 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 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