Re: [PATCH] drm/v3d: Fix memory leak in v3d_submit_cl_ioctl

2019-10-23 Thread Daniel Vetter
On Wed, Oct 23, 2019 at 11:16:01AM +0200, Daniel Vetter wrote: > On Tue, Oct 22, 2019 at 10:53:57PM -0500, Navid Emamdoost wrote: > > On Tue, Oct 22, 2019 at 4:36 AM Daniel Vetter wrote: > > > > > > On Mon, Oct 21, 2019 at 01:52:49PM -0500, Navid Emamdoost wrote: > > > > In the impelementation of

Re: [PATCH] drm/v3d: Fix memory leak in v3d_submit_cl_ioctl

2019-10-23 Thread Daniel Vetter
On Tue, Oct 22, 2019 at 10:53:57PM -0500, Navid Emamdoost wrote: > On Tue, Oct 22, 2019 at 4:36 AM Daniel Vetter wrote: > > > > On Mon, Oct 21, 2019 at 01:52:49PM -0500, Navid Emamdoost wrote: > > > In the impelementation of v3d_submit_cl_ioctl() there are two memory > > > leaks. One is when alloc

Re: [PATCH] drm/v3d: Fix memory leak in v3d_submit_cl_ioctl

2019-10-23 Thread Markus Elfring
> … >> +++ b/drivers/gpu/drm/v3d/v3d_gem.c >> @@ -557,13 +557,16 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data, > … >> if (ret) { >> v3d_job_put(&render->base); >> +kfree(bin); > … > > Can it be helpful to move the added function cal

Re: [PATCH] drm/v3d: Fix memory leak in v3d_submit_cl_ioctl

2019-10-22 Thread Navid Emamdoost
On Tue, Oct 22, 2019 at 4:36 AM Daniel Vetter wrote: > > On Mon, Oct 21, 2019 at 01:52:49PM -0500, Navid Emamdoost wrote: > > In the impelementation of v3d_submit_cl_ioctl() there are two memory > > leaks. One is when allocation for bin fails, and the other is when bin > > initialization fails. If

Re: [PATCH] drm/v3d: Fix memory leak in v3d_submit_cl_ioctl

2019-10-22 Thread Daniel Vetter
On Mon, Oct 21, 2019 at 01:52:49PM -0500, Navid Emamdoost wrote: > In the impelementation of v3d_submit_cl_ioctl() there are two memory > leaks. One is when allocation for bin fails, and the other is when bin > initialization fails. If kcalloc fails to allocate memory for bin then > render->base sh

Re: [PATCH] drm/v3d: Fix memory leak in v3d_submit_cl_ioctl

2019-10-21 Thread Markus Elfring
> In the impelementation of v3d_submit_cl_ioctl() there are two memory leaks. Please avoid another typo also in this change description. > … If kcalloc fails to allocate memory for bin then > render->base should be put. Also, if v3d_job_init() fails to initialize > bin->base then allocated memor

[PATCH] drm/v3d: Fix memory leak in v3d_submit_cl_ioctl

2019-10-21 Thread Navid Emamdoost
In the impelementation of v3d_submit_cl_ioctl() there are two memory leaks. One is when allocation for bin fails, and the other is when bin initialization fails. If kcalloc fails to allocate memory for bin then render->base should be put. Also, if v3d_job_init() fails to initialize bin->base then a