mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harry Wentland <hwentlan@amd.com>
To: Navid Emamdoost <navid.emamdoost@gmail.com>
Cc: "emamd001@umn.edu" <emamd001@umn.edu>,
	"smccaman@umn.edu" <smccaman@umn.edu>,
	"kjlu@umn.edu" <kjlu@umn.edu>,
	"Wentland, Harry" <Harry.Wentland@amd.com>,
	"Li, Sun peng (Leo)" <Sunpeng.Li@amd.com>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>,
	"Koenig, Christian" <Christian.Koenig@amd.com>,
	"Zhou, David(ChunMing)" <David1.Zhou@amd.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	"Lakha, Bhawanpreet" <Bhawanpreet.Lakha@amd.com>,
	"Cheng, Tony" <Tony.Cheng@amd.com>,
	"Laktyushkin, Dmytro" <Dmytro.Laktyushkin@amd.com>,
	"Yang, Eric" <Eric.Yang2@amd.com>, "Lei, Jun" <Jun.Lei@amd.com>,
	"Chalmers, Wesley" <Wesley.Chalmers@amd.com>,
	"Francis, David" <David.Francis@amd.com>,
	"Kazlauskas, Nicholas" <Nicholas.Kazlauskas@amd.com>,
	Aidan Wood <Aidan.Wood@amd.com>,
	"Chalmers, Kenneth" <Ken.Chalmers@amd.com>,
	"Bernstein, Eric" <Eric.Bernstein@amd.com>,
	"Wu, Hersen" <hersenxs.wu@amd.com>,
	Sam Ravnborg <sam@ravnborg.org>, "Li, Roman" <Roman.Li@amd.com>,
	Wang Hai <wanghai26@huawei.com>, Thomas Lim <Thomas.Lim@amd.com>,
	Su Sung Chung <Su.Chung@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/amd/display: prevent memory leak
Date: Wed, 25 Sep 2019 13:54:31 +0000	[thread overview]
Message-ID: <5cb6dec0-7f88-5d14-82cb-919f1d190b2f@amd.com> (raw)
In-Reply-To: <20190925042407.31383-1-navid.emamdoost@gmail.com>



On 2019-09-25 12:23 a.m., Navid Emamdoost wrote:
> In dcn*_create_resource_pool the allocated memory should be released if
> construct pool fails.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
>  drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 1 +
>  drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 1 +
>  drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 1 +
>  drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c | 1 +
>  drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c   | 1 +
>  5 files changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c
> index afc61055eca1..1787b9bf800a 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c
> @@ -1091,6 +1091,7 @@ struct resource_pool *dce100_create_resource_pool(
>  	if (construct(num_virtual_links, dc, pool))
>  		return &pool->base;
>  
> +	kfree(pool);
>  	BREAK_TO_DEBUGGER();
>  	return NULL;
>  }
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
> index c66fe170e1e8..318e9c2e2ca8 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
> @@ -1462,6 +1462,7 @@ struct resource_pool *dce110_create_resource_pool(
>  	if (construct(num_virtual_links, dc, pool, asic_id))
>  		return &pool->base;
>  
> +	kfree(pool);
>  	BREAK_TO_DEBUGGER();
>  	return NULL;
>  }
> diff --git a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
> index 3ac4c7e73050..3199d493d13b 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
> @@ -1338,6 +1338,7 @@ struct resource_pool *dce112_create_resource_pool(
>  	if (construct(num_virtual_links, dc, pool))
>  		return &pool->base;
>  
> +	kfree(pool);
>  	BREAK_TO_DEBUGGER();
>  	return NULL;
>  }
> diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
> index 7d08154e9662..bb497f43f6eb 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
> @@ -1203,6 +1203,7 @@ struct resource_pool *dce120_create_resource_pool(
>  	if (construct(num_virtual_links, dc, pool))
>  		return &pool->base;
>  
> +	kfree(pool);
>  	BREAK_TO_DEBUGGER();
>  	return NULL;
>  }
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
> index 5a89e462e7cc..59305e411a66 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
> @@ -1570,6 +1570,7 @@ struct resource_pool *dcn10_create_resource_pool(
>  	if (construct(init_data->num_virtual_links, dc, pool))
>  		return &pool->base;
>  
> +	kfree(pool);
>  	BREAK_TO_DEBUGGER();
>  	return NULL;
>  }
> 

  reply	other threads:[~2019-09-25 13:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25  4:23 Navid Emamdoost
2019-09-25 13:54 ` Harry Wentland [this message]
2019-09-25 16:04   ` Alex Deucher

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=5cb6dec0-7f88-5d14-82cb-919f1d190b2f@amd.com \
    --to=hwentlan@amd.com \
    --cc=Aidan.Wood@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Bhawanpreet.Lakha@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=David.Francis@amd.com \
    --cc=David1.Zhou@amd.com \
    --cc=Dmytro.Laktyushkin@amd.com \
    --cc=Eric.Bernstein@amd.com \
    --cc=Eric.Yang2@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Jun.Lei@amd.com \
    --cc=Ken.Chalmers@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=Roman.Li@amd.com \
    --cc=Su.Chung@amd.com \
    --cc=Sunpeng.Li@amd.com \
    --cc=Thomas.Lim@amd.com \
    --cc=Tony.Cheng@amd.com \
    --cc=Wesley.Chalmers@amd.com \
    --cc=airlied@linux.ie \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emamd001@umn.edu \
    --cc=hersenxs.wu@amd.com \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=navid.emamdoost@gmail.com \
    --cc=sam@ravnborg.org \
    --cc=smccaman@umn.edu \
    --cc=wanghai26@huawei.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®