[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADnq5_PKw4W18kY3jAhxjD6yMQqbt9X8OXwj4rb0opH3YsLBaQ@mail.gmail.com>
Date: Thu, 10 Nov 2022 14:53:09 -0500
From: Alex Deucher <alexdeucher@...il.com>
To: Luben Tuikov <luben.tuikov@....com>
Cc: Dong Chenchen <dongchenchen2@...wei.com>, airlied@...il.com,
daniel@...ll.ch, Xinhui.Pan@....com, yuehaibing@...wei.com,
linux-kernel@...r.kernel.org, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, alexander.deucher@....com,
christian.koenig@....com
Subject: Re: [PATCH] drm/amdgpu: Fix memory leak in amdgpu_cs_pass1
On Thu, Nov 10, 2022 at 1:08 PM Luben Tuikov <luben.tuikov@....com> wrote:
>
> Thanks for fixing this.
>
> Please add a Cc tag to stable, and repost.
No need for stable. This patch just went upstream in 6.1, so I can
include it in my 6.1 fixes pull next week. Applied.
Thanks!
Alex
>
> Reviewed-by: Luben Tuikov <luben.tuikov@....com>
>
> Regards,
> Luben
>
> On 2022-11-10 09:33, Dong Chenchen wrote:
> > When p->gang_size equals 0, amdgpu_cs_pass1() will return directly
> > without freeing chunk_array, which will cause a memory leak issue,
> > this patch fixes it.
> >
> > Fixes: 4624459c84d7 ("drm/amdgpu: add gang submit frontend v6")
> > Signed-off-by: Dong Chenchen <dongchenchen2@...wei.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > index 1bbd39b3b0fc..0e24d6b80e0b 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > @@ -287,8 +287,10 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
> > }
> > }
> >
> > - if (!p->gang_size)
> > - return -EINVAL;
> > + if (!p->gang_size) {
> > + ret = -EINVAL;
> > + goto free_partial_kdata;
> > + }
> >
> > for (i = 0; i < p->gang_size; ++i) {
> > ret = amdgpu_job_alloc(p->adev, num_ibs[i], &p->jobs[i], vm);
>
Powered by blists - more mailing lists