mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: "Harshit Mogalapalli" <harshit.m.mogalapalli@oracle.com>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David (ChunMing) Zhou" <David1.Zhou@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Sherry Yang" <sherry.yang@oracle.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Sasha Levin" <sashal@kernel.org>, "Roman Li" <roman.li@amd.com>,
	"Claudio Suarez" <cssk@net-c.es>, hongao <hongao@uniontech.com>,
	"Aurabindo Pillai" <aurabindo.pillai@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, error27@gmail.com,
	dan.carpenter@linaro.org
Subject: Re: [PATCH] drm/amd/display: Fix memory leak in dm_set_writeback()
Date: Mon, 11 Dec 2023 13:12:38 -0700	[thread overview]
Message-ID: <04d3806d-7d45-4166-917d-7250a2f5456f@amd.com> (raw)
In-Reply-To: <20231208095825.1291730-1-harshit.m.mogalapalli@oracle.com>

Thanks for catching this.

Reviewed-by: Alex Hung <alex.hung@amd.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@oracle.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;
>   	}
>   

      reply	other threads:[~2023-12-11 20:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  9:58 Harshit Mogalapalli
2023-12-11 20:12 ` Alex Hung [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=04d3806d-7d45-4166-917d-7250a2f5456f@amd.com \
    --to=alex.hung@amd.com \
    --cc=David1.Zhou@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=cssk@net-c.es \
    --cc=dan.carpenter@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=harry.wentland@amd.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=hongao@uniontech.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roman.li@amd.com \
    --cc=sashal@kernel.org \
    --cc=sherry.yang@oracle.com \
    --cc=sunpeng.li@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®