[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <04d3806d-7d45-4166-917d-7250a2f5456f@amd.com>
Date: Mon, 11 Dec 2023 13:12:38 -0700
From: Alex Hung <alex.hung@....com>
To: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>,
Harry Wentland <harry.wentland@....com>,
Leo Li <sunpeng.li@....com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
"David (ChunMing) Zhou" <David1.Zhou@....com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Sherry Yang <sherry.yang@...cle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sasha Levin <sashal@...nel.org>, Roman Li <roman.li@....com>,
Claudio Suarez <cssk@...-c.es>, hongao <hongao@...ontech.com>,
Aurabindo Pillai <aurabindo.pillai@....com>,
amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, error27@...il.com,
dan.carpenter@...aro.org
Subject: Re: [PATCH] drm/amd/display: Fix memory leak in dm_set_writeback()
Thanks for catching this.
Reviewed-by: Alex Hung <alex.hung@....com>
On 2023-12-08 02:58, Harshit Mogalapalli wrote:
> 'wb_info' needs to be freed on error paths or it would leak the memory.
>
> Smatch pointed this out.
>
> Fixes: c81e13b929df ("drm/amd/display: Hande writeback request from userspace")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
> ---
> This is based on static analysis and only compile tested
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index afdcc43ea06c..333995f70239 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -8871,12 +8871,14 @@ static void dm_set_writeback(struct amdgpu_display_manager *dm,
> acrtc = to_amdgpu_crtc(wb_conn->encoder.crtc);
> if (!acrtc) {
> DRM_ERROR("no amdgpu_crtc found\n");
> + kfree(wb_info);
> return;
> }
>
> afb = to_amdgpu_framebuffer(new_con_state->writeback_job->fb);
> if (!afb) {
> DRM_ERROR("No amdgpu_framebuffer found\n");
> + kfree(wb_info);
> return;
> }
>
Powered by blists - more mailing lists