Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2196581iof; Tue, 7 Jun 2022 22:54:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTIFfE5FdYMATEWFwTw7hirhBd0VMBoME/gy3DF+VCiofCj/vgPsiLADCUCQkaXVQ1OG6u X-Received: by 2002:a17:902:ccd0:b0:156:7ac2:5600 with SMTP id z16-20020a170902ccd000b001567ac25600mr32056394ple.156.1654667672116; Tue, 07 Jun 2022 22:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667672; cv=none; d=google.com; s=arc-20160816; b=0egu43nTUTnVKqsoEJPdc5RrGxuQfTSmHUb4vrVm5xw7dGVAi7/XfJ2at+D9vEY5Tg EVPgh6J5hiKh5ud9qG7CYkubc3XL+DOWTO4hBW9rE+uhKyJealX45Xh6YIxjAbS3HamZ vFj7nTwDLHvotJprJL3No3HAAyW4N0qL/WdxMWcLbAX7iop8NxiFGj+yuPaCMaDp0Io+ 2xsl9vj7Zg692WqYW7d5ryt+fUaruuRlgQtybcGNGyybfkIa5LglaDhI5aiihyycNkEJ I9GKGEEVjugsb8Zp+L0TN4qjw7teFVtD2tLADVmf5O8N2WMamrrzQDnVKQxAGUt5GhxS hJFg== 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=5dN/2rObpKryt8OmPLnhIP75L3+IKnzo9v0Zpy5nDj0=; b=AwBhSFVeA2K1KoN0QJMYmlbx5ncdF26IxbVuX5UaRpFMJcQq8Zl/zAi2aI7iFxkbyj D2/41o2sNnTpDc1DzG84pjTxjpTtATh24C9TNN8ct1ALDuwGzwyFfG/7Oi/5CVf+lWDW f5XS/bJcJTn7zmKv0Moc7HzhJ9wNHe4Ze5NfoGwt9zNamDhUQIazU/ENfM2GtiMA9vBG ANWtRRZ+9iIi+N9zHns6aU0d8uchmfpUibzrAyVu1kVZnuTO6MbzK3eRjI+JF/03EsGW Tv0smg8uEoCYcxQyQOHUEOAwf+HZfAFQazG0XPQToBpsh7KWRaaXclbuSewF7kdGRp8b 5sHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z9k6rp69; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k2-20020a170902ba8200b00153b2d165e8si25939573pls.496.2022.06.07.22.54.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:54:32 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z9k6rp69; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D5AAE483960; Tue, 7 Jun 2022 22:21:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442657AbiFHAzp (ORCPT + 99 others); Tue, 7 Jun 2022 20:55:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382083AbiFGVqY (ORCPT ); Tue, 7 Jun 2022 17:46:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90B88235B11; Tue, 7 Jun 2022 12:07:48 -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 ams.source.kernel.org (Postfix) with ESMTPS id 4B5A0B8220B; Tue, 7 Jun 2022 19:07:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B84F1C385A2; Tue, 7 Jun 2022 19:07:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628866; bh=4C1h2APh3CwOXJj7ov7hB5hxZUv1g2wu/xSwijirYak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z9k6rp69SAxoOwZfc0HyW4I89gxWfFQmo5PQ9/5UcXGgiwBoFEt8Zj+aTLR5CkfWU vHEGto887FzEZRfsJRTOsIcrKnFQI2EBAtBzE3g4fhs+XygLE/WxszcJ9f3MP3BYd2 /QxHXEVD7UCl5tG50pKNxq/t5mRFKIjnC1Ok7fVs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Akhil P Oommen , Rob Clark , Sasha Levin Subject: [PATCH 5.18 484/879] drm/msm/a6xx: Fix refcount leak in a6xx_gpu_init Date: Tue, 7 Jun 2022 19:00:02 +0200 Message-Id: <20220607165016.922249286@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 c56de483093d7ad0782327f95dda7da97bc4c315 ] of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. a6xx_gmu_init() passes the node to of_find_device_by_node() and of_dma_configure(), of_find_device_by_node() will takes its reference, of_dma_configure() doesn't need the node after usage. Add missing of_node_put() to avoid refcount leak. Fixes: 4b565ca5a2cb ("drm/msm: Add A6XX device support") Signed-off-by: Miaoqian Lin Reviewed-by: Akhil P Oommen Link: https://lore.kernel.org/r/20220512121955.56937-1-linmq006@gmail.com Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index ccc4fcf7a630..a8f6d73197b1 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1919,6 +1919,7 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) BUG_ON(!node); ret = a6xx_gmu_init(a6xx_gpu, node); + of_node_put(node); if (ret) { a6xx_destroy(&(a6xx_gpu->base.base)); return ERR_PTR(ret); -- 2.35.1