Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2914035rwb; Mon, 15 Aug 2022 13:58:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR6CBjKAjTIKr+U6IzKRyxsOwrJGCt1Gi41VsRfUjeenElfoHYvCq6X+GAmBcA3HRLl3f2gU X-Received: by 2002:a65:5503:0:b0:41b:bbdc:9a5d with SMTP id f3-20020a655503000000b0041bbbdc9a5dmr15015459pgr.587.1660597093373; Mon, 15 Aug 2022 13:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597093; cv=none; d=google.com; s=arc-20160816; b=OGlDeAVUjQchPcEgY6GfgEXfQsKOmHjTfQzkJi3aQvoV+5GNniZL4YkHymdDOsxPTV nCdLhTHM3vwobiZTjtOoBKFUhxGsGjDLfGIcMb4Q/y69wITblWBiG4Cov9XNryd7rrCN X2M9FmtAqR/kWIxkksgt4Frq6MA+4ZSYYK9brFqN2PQJ8TU2gDNr0tAiCYezNc5m52fp yx9hZcp9i8R4Vc9eH67y+u+jGrwFUDYnMjeQghvlMtq6wFWG++5P3xJYrDczLKn/i6cF 7yaJVjnI3+pKpUn7W1XiG5tQnD23XAyu51ndjmxlj89h0uy5SwMDkMMy6ptSGy1/Work LqkQ== 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=yMwz7PN1dQUeAhCmcBDk4ZQtYkZi1ElQWZ2v/Q/37Xw=; b=z6xIdbiY2PWJieB6GhYCNrTZv9a70tpnfxnyx8ilvPDeja5wsjedTVjxv2qEMY5ljy SWf0uTPB2Jl5bjc7KAIeLEylyHAe3JoVlTTsc0+JWVBmyO6rGbGzS3ug+sQ0LEs3CXa1 BR9ALk9DUv+NW8OXyFwAbpCJxOduhXjs4YVbfjaN2Kya70jHc8RRp8Uyx1kDISc/wy+p H5X5NF6XVIakatM7VD8ybeabUAz9yJxFbFHRs+sWj1UqmS+AjUHCQLmXJ7FGKcBVL6AM 9iwh5CtTmQDg6vPtLSeB7x9G0BmS8RG5AD7Q2Ld9z1HDx93t4UFcTHUK2oF4d+3vMbPZ Ql3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rw3SgLBY; 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 u5-20020a170902b28500b001726fbd5067si3767958plr.624.2022.08.15.13.57.57; Mon, 15 Aug 2022 13:58:13 -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=rw3SgLBY; 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 S244580AbiHOS6Z (ORCPT + 99 others); Mon, 15 Aug 2022 14:58:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244715AbiHOSzp (ORCPT ); Mon, 15 Aug 2022 14:55:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51175128; Mon, 15 Aug 2022 11:30:15 -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 657A460F9F; Mon, 15 Aug 2022 18:30:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05AFFC433C1; Mon, 15 Aug 2022 18:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588213; bh=2VervNbxgxeZXfNV44+wbwlA2Se2WoQVV5BHYKxRI50=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rw3SgLBYYD/cI2VllJBa4bXww5D7cClzDgxyQ4+3dt4Y1lDgO/moo7A4nFtAnNTc8 tPBFvFv5xixsD5IKqkc4fprF8uOqr+VAd/oI25BjB0C8qO4wGRYz76Ix5ugpwe27uO 4FPTWTEevvo+8cjsapUnA/qHDBvFmqIvj1cV8k8M= 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.15 289/779] drm/mcde: Fix refcount leak in mcde_dsi_bind Date: Mon, 15 Aug 2022 19:58:53 +0200 Message-Id: <20220815180349.642523280@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 180ebbccbeda..0b58d7f4ba78 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