Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2891553iog; Mon, 27 Jun 2022 05:12:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uLgTeh4tzkJrzmVglZIzTFxLZkcHNfYLl4SS5K4biCns1DrPpL0chutAKCuEQ1igg0sD05 X-Received: by 2002:a05:6402:3491:b0:435:8939:1989 with SMTP id v17-20020a056402349100b0043589391989mr16561249edc.23.1656331920526; Mon, 27 Jun 2022 05:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656331920; cv=none; d=google.com; s=arc-20160816; b=gTI2v6mSWpMiIjGkkK/hKboOyqJbzgXw9bDwXDJ1p+3KXCiVTLOVGsD0EuLhT65PLH 6WVu9jZnuvvR3067mFUBWQXUbWfgEFQZN/C0JeRssCExUyrFMKpQviiQBqGGceoIOI9l bif2emL18hNAaJ0IKkXFau+RhZfyvR0nznY/uMfFzGy+LWCUbnYxC40dakE5IkiJhtAj KW5ByJZaUl8vkfHrqvjdWc/53QJbFBEMEGio+Orf7hMOi/mGiJ1UCH6lC7a/BO7gufnp Dk9HgjcVVVTxYPetBeM1aweSGvzDl3Ms7j5zpmgPu+eHN/NrwnI/kou9fMUBAAw/Y4eE NibA== 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=oGu3XqRbDlnzVeP0vO6UrX/qwkKmfTV9RJe+SQ1NtjM=; b=IScQOihCpBj9kimsidqd9OKphg1FwkKB9ppE7OCNvQ4bdmthtWOIuwfiIw+VIyCpBU 0BUMDqoY1P7cUrwX2Eet+ay+5iaOxhgqvVDaG2FxVZvTDg1ZpxNaAbQ15QmhiR38vbhv fgLnXy/kXt2jbPcQZWUlX3jn2bNgS5U9HYFUCctDYHhSASCPfKnSEK1HrtwRo+GMMpkk BWMBYq0kSUnSoWyeK4rOhisH8hpJOz2LrMQ2ng8gaTC1YAv3HL4jC2jmwEiTn5e7wHen QA3lWCNJIvurdijKwAx/jK2x5yJf1olEIROhlyLe0FXP1j/9lTDV7sl1TFZ7ZiN0koiX CBRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M9Szu7tc; 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 c13-20020a50f60d000000b0042dd46e6590si6973236edn.336.2022.06.27.05.11.36; Mon, 27 Jun 2022 05:12:00 -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=M9Szu7tc; 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 S234775AbiF0LYm (ORCPT + 99 others); Mon, 27 Jun 2022 07:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234741AbiF0LYX (ORCPT ); Mon, 27 Jun 2022 07:24:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC1726579; Mon, 27 Jun 2022 04:24:22 -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 685A261366; Mon, 27 Jun 2022 11:24:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60DD3C3411D; Mon, 27 Jun 2022 11:24:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329061; bh=fNCokIlPXv3LxEl/Ny3/4Y5p9HvmwaTsoXsf4L9t5Is=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M9Szu7tcYjnvk1UouvUTal9jYadGaSTcerZOgXvBhom+CHECGVQtc3VUs8z1imx6x OhPZj9d80mlCVXy/RQVikZHgzcUZppC2VvvncE9zRlvXt5PdaQMGaZy5PsCSac8wuj nUYitUVY35H2lFGTVRcWDLHstZs/ROLsQ/+jyzTQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Dmitry Baryshkov , Stephen Boyd , Abhinav Kumar , Rob Clark , Sasha Levin Subject: [PATCH 5.10 036/102] drm/msm/mdp4: Fix refcount leak in mdp4_modeset_init_intf Date: Mon, 27 Jun 2022 13:20:47 +0200 Message-Id: <20220627111934.535322164@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111933.455024953@linuxfoundation.org> References: <20220627111933.455024953@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 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 b9cc4598607cb7f7eae5c75fc1e3209cd52ff5e0 ] of_graph_get_remote_node() returns remote device node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 86418f90a4c1 ("drm: convert drivers to use of_graph_get_remote_node") Signed-off-by: Miaoqian Lin Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/488473/ Link: https://lore.kernel.org/r/20220607110841.53889-1-linmq006@gmail.com Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c index 913de5938782..b4d0bfc83d70 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c @@ -221,6 +221,7 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms, encoder = mdp4_lcdc_encoder_init(dev, panel_node); if (IS_ERR(encoder)) { DRM_DEV_ERROR(dev->dev, "failed to construct LCDC encoder\n"); + of_node_put(panel_node); return PTR_ERR(encoder); } @@ -230,6 +231,7 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms, connector = mdp4_lvds_connector_init(dev, panel_node, encoder); if (IS_ERR(connector)) { DRM_DEV_ERROR(dev->dev, "failed to initialize LVDS connector\n"); + of_node_put(panel_node); return PTR_ERR(connector); } -- 2.35.1