Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2905007iog; Mon, 27 Jun 2022 05:29:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ux56Etaykv52J/UWBUekbfmJInhMuVceqw2tPD65kl3nJRE/045N8/MdpLUlmgd2pHCFN8 X-Received: by 2002:a17:906:2086:b0:717:4e91:f1db with SMTP id 6-20020a170906208600b007174e91f1dbmr12220788ejq.345.1656332958541; Mon, 27 Jun 2022 05:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656332958; cv=none; d=google.com; s=arc-20160816; b=FzHM5lOhEfLRIFFqXi1d5LNEpTpd5GQUiLqfv5+ZkCbf7Z3oHP8KgXH8GH4O8sNkHw sZtjeSGCx5TlzPDLnopAN7ZCGb4i6+YLbytkLFlqvRkdtIIn3IzcvDsKGSHr9nSExHZa wX4W49Poi8CuhARY3RNwo33FE5MIPxFdXgbF2k2hZiYEtwA4/y+UmxYbwjXx5yrKn3l+ GzA5YrkRnGLzBeEBLdQLoIZ1ZZPttaNoxqbhkT5zj6zckBgS8QlqwlOKxaK58izpxPQk kh8U1ZwhHlyE5dj4Iyt26V7PnaCmUtD/k6HlkNobay2Bu5zdTGUzYdivdD6cjOUD7oUX 4sbg== 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=68I/ssGc/H5ZQe+GNoH/l0Yc6AaxyFg8bvZSXy+7i6o=; b=NYLPWOntgAjVBWV8/w3kwBQA7mGeM3IKrANDAiSzvTmVHUfBNHamPO3kb5s+y4zh5k eWDg8WANRFIslayJ6ORxt2REL+bRoJ8Rq0Xvp7tmRv77wyOudUO8vppZFyJvI0Utbd6l Z+G9fKWtwemDNT/eSnpJSBmW27lcggPOA3t5IIxzfhb+ZXe/ka8bXPzRSvizEd7fLOxZ pjPcEWGWVUzQns+ShqaDO7I5wIDRdq6AoG1mSXTb5FKVd2dYfZpuyRatRNo67ofrhK0I 4EBrpJZEhNa2YPu1e8tMTIuAVEgL8voF8HylxNBaEpBeMsV49B2LIU4evQzjpDcOPbyb bukg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Oeifk1Iu; 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 g22-20020a1709065d1600b00726be93113esi951783ejt.707.2022.06.27.05.28.53; Mon, 27 Jun 2022 05:29:18 -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=Oeifk1Iu; 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 S235228AbiF0Lb2 (ORCPT + 99 others); Mon, 27 Jun 2022 07:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235402AbiF0LbB (ORCPT ); Mon, 27 Jun 2022 07:31:01 -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 4C936C35; Mon, 27 Jun 2022 04:28:43 -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 C51B16149A; Mon, 27 Jun 2022 11:28:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB7ACC3411D; Mon, 27 Jun 2022 11:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329322; bh=hWor5TbAdbXUvesvXIX1mOkRXrLBzYeK9PD0uprgNdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oeifk1IuurWjqKY4W40Iak+j9IjNLQcGgK8KRpWCfmmrEH+phz6cNAeG8R/pX0IZq YehFES4Ib/goUmwAHei6vf6lIB1yKXe49BZOgjOhwWHmRg5dQn0RF5muSKzuyixU+N zwZqXxYG7zdI0v7SkNZNgvEgW5GgGd1obSKHmf1I= 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.4 21/60] drm/msm/mdp4: Fix refcount leak in mdp4_modeset_init_intf Date: Mon, 27 Jun 2022 13:21:32 +0200 Message-Id: <20220627111928.287391461@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@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 4f0c6d58e06f..f0a5767b69f5 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c @@ -245,6 +245,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); } @@ -254,6 +255,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