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

2019-10-01 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 any allocation attemp for > >

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

2019-09-29 Thread Markus Elfring
> v2: moved the released into goto error handlings A better version comment should be moved below the triple dashes. Will the tag “Fixes” be added? > @@ -393,6 +395,16 @@ static int acp_hw_init(void *handle) > val &= ~ACP_SOFT_RESET__SoftResetAud_MASK; >

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

2019-09-20 Thread Sven Van Asbroeck
Hi Christian, On Thu, Sep 19, 2019 at 4:05 AM Koenig, Christian wrote: > > > +out4: > > + kfree(i2s_pdata); > > +out3: > > + kfree(adev->acp.acp_res); > > +out2: > > + kfree(adev->acp.acp_cell); > > +out1: > > + kfree(adev->acp.acp_genpd); > > kfree on a NULL pointer is harmless,

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

2019-09-19 Thread Koenig, Christian
Am 19.09.19 um 16:28 schrieb Sven Van Asbroeck: > Hi Christian, > > On Thu, Sep 19, 2019 at 4:05 AM Koenig, Christian > wrote: >>> +out4: >>> + kfree(i2s_pdata); >>> +out3: >>> + kfree(adev->acp.acp_res); >>> +out2: >>> + kfree(adev->acp.acp_cell); >>> +out1: >>> +

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

2019-09-19 Thread Koenig, Christian
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 any allocation attemp for > adev->acp.acp_cell, adev->acp.acp_res or i2s_pdata fails. > 2- all of those

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

2019-09-19 Thread 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 any allocation attemp for adev->acp.acp_cell, adev->acp.acp_res or i2s_pdata fails. 2- all of those allocations should be released if pm_genpd_add_device fails.

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

2019-09-19 Thread Sven Van Asbroeck
On Wed, Sep 18, 2019 at 3:09 PM Navid Emamdoost wrote: > > i2s_pdata = kcalloc(3, sizeof(struct i2s_platform_data), GFP_KERNEL); > if (i2s_pdata == NULL) { > - kfree(adev->acp.acp_res); > - kfree(adev->acp.acp_cell); > - return -ENOMEM; >