From mboxrd@z Thu Jan 1 00:00:00 1970 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 21C4AC3DA6E for ; Thu, 28 Dec 2023 16:51:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 658A410E0CF; Thu, 28 Dec 2023 16:51:19 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 95F9710E0CF for ; Thu, 28 Dec 2023 16:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703782278; x=1735318278; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=XYOTYJ77YKnUFrVlaJSxWr2I93Md1Ed7ac29wDvu4Fg=; b=XjY3XksUTn12S+n8xcjUpru1jnLXPYoxRNT7Nu23x51x+i1cCCjzVXhy LkwsNAEAwf76U1xOsc7u88BaoKFd0xCKb290HKrLSWPWMOG6uhxCc0y67 sRTspJqyA1pI0WmJorqA5eOEKqqIv3bU6RGBXA+KjTXKatgbXu3seSc+0 Ul8TuO0DEd3JztLMjevpC6uSkwVr8Aueq+u/Vqwd77NOEZbc0LCIIYjWf RpIoHAtAk24M9nxAAAjQ05nMfPB8t/r5HYuG6rtYVZDLhYsnPiAb9UF/L S6HeKjxTCdw2L9QknUxomETMLh48x9YOGCIr2ShPkqPB0nYM0yh4U7hQe g==; X-IronPort-AV: E=McAfee;i="6600,9927,10937"; a="395455934" X-IronPort-AV: E=Sophos;i="6.04,312,1695711600"; d="scan'208";a="395455934" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2023 08:51:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10937"; a="848987390" X-IronPort-AV: E=Sophos;i="6.04,312,1695711600"; d="scan'208";a="848987390" Received: from noblecat-mobl.ger.corp.intel.com (HELO localhost) ([10.252.35.63]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2023 08:51:15 -0800 Date: Thu, 28 Dec 2023 15:04:37 +0100 From: Stanislaw Gruszka To: Yaxiong Tian Subject: Re: [PATCH] drm/debugfs: fix memory leak in drm_debugfs_remove_files() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: tzimmermann@suse.de, linux-kernel@vger.kernel.org, mripard@kernel.org, dri-devel@lists.freedesktop.org, Yaxiong Tian , airlied@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Dec 28, 2023 at 04:07:40PM +0800, Yaxiong Tian wrote: > From: Yaxiong Tian > > The dentry returned by debugfs_lookup() needs to be released by calling > dput() which is missing in drm_debugfs_remove_files(). Fix this by adding > dput(). > > Signed-off-by: Yaxiong Tian Reviewed-by: Stanislaw Gruszka > --- > drivers/gpu/drm/drm_debugfs.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c > index f4715a67e340..4d299152c302 100644 > --- a/drivers/gpu/drm/drm_debugfs.c > +++ b/drivers/gpu/drm/drm_debugfs.c > @@ -277,6 +277,7 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count, > > drmm_kfree(minor->dev, d_inode(dent)->i_private); > debugfs_remove(dent); > + dput(dent); > } > return 0; > } > -- > 2.25.1 > From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8F99F4EC for ; Thu, 28 Dec 2023 16:51:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XjY3XksU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703782278; x=1735318278; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=XYOTYJ77YKnUFrVlaJSxWr2I93Md1Ed7ac29wDvu4Fg=; b=XjY3XksUTn12S+n8xcjUpru1jnLXPYoxRNT7Nu23x51x+i1cCCjzVXhy LkwsNAEAwf76U1xOsc7u88BaoKFd0xCKb290HKrLSWPWMOG6uhxCc0y67 sRTspJqyA1pI0WmJorqA5eOEKqqIv3bU6RGBXA+KjTXKatgbXu3seSc+0 Ul8TuO0DEd3JztLMjevpC6uSkwVr8Aueq+u/Vqwd77NOEZbc0LCIIYjWf RpIoHAtAk24M9nxAAAjQ05nMfPB8t/r5HYuG6rtYVZDLhYsnPiAb9UF/L S6HeKjxTCdw2L9QknUxomETMLh48x9YOGCIr2ShPkqPB0nYM0yh4U7hQe g==; X-IronPort-AV: E=McAfee;i="6600,9927,10937"; a="395455929" X-IronPort-AV: E=Sophos;i="6.04,312,1695711600"; d="scan'208";a="395455929" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2023 08:51:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10937"; a="848987390" X-IronPort-AV: E=Sophos;i="6.04,312,1695711600"; d="scan'208";a="848987390" Received: from noblecat-mobl.ger.corp.intel.com (HELO localhost) ([10.252.35.63]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2023 08:51:15 -0800 Date: Thu, 28 Dec 2023 15:04:37 +0100 From: Stanislaw Gruszka To: Yaxiong Tian Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Yaxiong Tian Subject: Re: [PATCH] drm/debugfs: fix memory leak in drm_debugfs_remove_files() Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Dec 28, 2023 at 04:07:40PM +0800, Yaxiong Tian wrote: > From: Yaxiong Tian > > The dentry returned by debugfs_lookup() needs to be released by calling > dput() which is missing in drm_debugfs_remove_files(). Fix this by adding > dput(). > > Signed-off-by: Yaxiong Tian Reviewed-by: Stanislaw Gruszka > --- > drivers/gpu/drm/drm_debugfs.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c > index f4715a67e340..4d299152c302 100644 > --- a/drivers/gpu/drm/drm_debugfs.c > +++ b/drivers/gpu/drm/drm_debugfs.c > @@ -277,6 +277,7 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count, > > drmm_kfree(minor->dev, d_inode(dent)->i_private); > debugfs_remove(dent); > + dput(dent); > } > return 0; > } > -- > 2.25.1 >