[PATCH] drm/amdgpu/display: fix ref count leak when pm_runtime_get_sync fails

2020-06-15 Thread Navid Emamdoost
The call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 16 1 file changed

[PATCH] drm/amd/display: fix ref count leak in amdgpu_drm_ioctl

2020-06-15 Thread Navid Emamdoost
in amdgpu_drm_ioctl the call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- 1 file changed, 2

[PATCH] drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config

2020-06-15 Thread Navid Emamdoost
in amdgpu_display_crtc_set_config, the call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 5

[PATCH] drm/amdgpu: fix ref count leak in amdgpu_driver_open_kms

2020-06-15 Thread Navid Emamdoost
in amdgpu_driver_open_kms the call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 ++- 1 file

[PATCH] drm/amdgpu: Fix memory leak in amdgpu_fence_emit

2019-10-22 Thread Navid Emamdoost
In the impelementation of amdgpu_fence_emit() if dma_fence_wait() fails and returns an errno, before returning the allocated memory for fence should be released. Fixes: 3d2aca8c8620 ("drm/amdgpu: fix old fence check in amdgpu_fence_emit") Signed-off-by: Navid Emamdoost --- drivers/g

Re: [PATCH v3] drm/amdgpu: fix multiple memory leaks in acp_hw_init

2019-10-01 Thread Navid Emamdoost
On Tue, Oct 1, 2019 at 7:19 AM Koenig, Christian wrote: > > Am 30.09.19 um 23:26 schrieb Navid Emamdoost: > > In acp_hw_init there are some allocations that needs to be released in > > case of failure: > > > > 1- adev->acp.acp_genpd should be released if a

[PATCH v4] drm/amdgpu: fix multiple memory leaks in acp_hw_init

2019-10-01 Thread Navid Emamdoost
evices or pm_genpd_add_device fail. 3- Release is needed in case of time out values expire. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 34 - 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu

Re: [PATCH] drm/amd/display: memory leak

2019-10-01 Thread Navid Emamdoost
Would you please review this patch? Thanks, Navid. On Mon, Sep 16, 2019 at 10:21 PM Navid Emamdoost wrote: > > In dcn*_clock_source_create when dcn20_clk_src_construct fails allocated > clk_src needs release. > > Signed-off-by: Navid Emamdoost > --- > drivers/gpu/drm/

Re: [PATCH v2] drm/amdgpu: fix multiple memory leaks

2019-09-30 Thread Navid Emamdoost
On Thu, Sep 19, 2019 at 3:03 AM Koenig, Christian wrote: > > Am 18.09.19 um 21:05 schrieb Navid Emamdoost: > > In acp_hw_init there are some allocations that needs to be released in > > case of failure: > > > > 1- adev->acp.acp_genpd should be released if a

[PATCH v3] drm/amdgpu: fix multiple memory leaks in acp_hw_init

2019-09-30 Thread Navid Emamdoost
evices or pm_genpd_add_device fail. 3- Release is needed in case of time out values expire. Signed-off-by: Navid Emamdoost --- Changes in v2: -- moved the releases under goto Changes in v3: -- fixed multiple goto issue -- added goto for 3 other failure cases:

[PATCH] drm/amd/display: prevent memory leak

2019-09-24 Thread Navid Emamdoost
In dcn*_create_resource_pool the allocated memory should be released if construct pool fails. Signed-off-by: Navid Emamdoost --- 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

[PATCH] drm/amdgpu: release allocated memory

2019-09-20 Thread Navid Emamdoost
In amdgpu_vmid_grab_idle, fences is being leaked in one execution path. The missing kfree was added. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c b/drivers/gpu/drm/amd

Re: [PATCH] drm/amdgpu: fix multiple memory leaks

2019-09-18 Thread Navid Emamdoost
Thanks Christian for the feedback, I'll send a v2. On Wed, Sep 18, 2019 at 12:31 PM Koenig, Christian wrote: > Am 18.09.19 um 18:09 schrieb Navid Emamdoost: > > In acp_hw_init there are some allocations that needs to be released in > > case of failure: > > > >

[PATCH v2] drm/amdgpu: fix multiple memory leaks

2019-09-18 Thread Navid Emamdoost
ails. v2: moved the released into goto error handlings Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 30 + 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/a

[PATCH] drm/amdgpu: fix multiple memory leaks

2019-09-18 Thread Navid Emamdoost
ice fails. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index eba42c752bca..dd3fa85b11c5 100644 --- a/driver

[PATCH] drm/amd/display: memory leak

2019-09-16 Thread Navid Emamdoost
In dcn*_clock_source_create when dcn20_clk_src_construct fails allocated clk_src needs release. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 3 ++- drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 1 + drivers/gpu/drm/amd/display/dc