From patchwork Tue Sep 13 14:02:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 12974824 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 93C9FC6FA82 for ; Tue, 13 Sep 2022 14:10:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5868510E720; Tue, 13 Sep 2022 14:10:11 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 549B710E720; Tue, 13 Sep 2022 14:10:05 +0000 (UTC) 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 95728614BC; Tue, 13 Sep 2022 14:10:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 615A8C433D7; Tue, 13 Sep 2022 14:10:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078203; bh=pI/efMIRfMPLZEbOkc0FWEqztzpGq+Ww3EmELNCn0n8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=APFRULcUUQhC5Bjf2hZrozIk651s9UUhovWW7RF/UgQKuWUHVLcP7a9zomh0ASfDR FOfu95e72+aCsHrbMLQ9DMjuVdtAl4MglEUtrQ1HDaQ2W7u/TCVYGUVf3VnaftrPGU 17kJf6VuzQTZS+ZBgwSPLbFwArlnTny9zZUIp9hc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Subject: [PATCH 5.19 052/192] drm/amd/display: fix memory leak when using debugfs_lookup() Date: Tue, 13 Sep 2022 16:02:38 +0200 Message-Id: <20220913140412.529529553@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140410.043243217@linuxfoundation.org> References: <20220913140410.043243217@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Wenjing Liu , dri-devel@lists.freedesktop.org, Jiapeng Chong , Rodrigo Siqueira , amd-gfx@lists.freedesktop.org, Yongzhi Liu , Fangzhi Zuo , Thelford Williams , Leo Li , Bhanuprakash Modem , Sean Paul , Mikita Lipski , Greg Kroah-Hartman , "Pan, Xinhui" , stable@vger.kernel.org, Wayne Lin , Alex Deucher , hersen wu , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Greg Kroah-Hartman commit cbfac7fa491651c57926c99edeb7495c6c1aeac2 upstream. When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. Fix this up by properly calling dput(). Cc: Harry Wentland Cc: Leo Li Cc: Rodrigo Siqueira Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: Wayne Lin Cc: hersen wu Cc: Wenjing Liu Cc: Patrik Jakobsson Cc: Thelford Williams Cc: Fangzhi Zuo Cc: Yongzhi Liu Cc: Mikita Lipski Cc: Jiapeng Chong Cc: Bhanuprakash Modem Cc: Sean Paul Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: stable@vger.kernel.org Reviewed-by: Rodrigo Siqueira Signed-off-by: Greg Kroah-Hartman Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c @@ -3188,7 +3188,7 @@ void crtc_debugfs_init(struct drm_crtc * &crc_win_y_end_fops); debugfs_create_file_unsafe("crc_win_update", 0644, dir, crtc, &crc_win_update_fops); - + dput(dir); } #endif /*