[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADaigPWfTDJ_G6z3ZKm-bqBO8LPthEBkJoqXk=znGqvDhkw3bw@mail.gmail.com>
Date: Thu, 17 Sep 2020 19:05:46 -0700
From: Eric Anholt <eric@...olt.net>
To: Sasha Levin <sashal@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, stable@...r.kernel.org,
Iago Toral Quiroga <itoral@...lia.com>,
DRI Development <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH AUTOSEL 5.4 001/330] drm/v3d: don't leak bin job if
v3d_job_init fails.
On Thu, Sep 17, 2020 at 7:01 PM Sasha Levin <sashal@...nel.org> wrote:
>
> From: Iago Toral Quiroga <itoral@...lia.com>
>
> [ Upstream commit 0d352a3a8a1f26168d09f7073e61bb4b328e3bb9 ]
>
> If the initialization of the job fails we need to kfree() it
> before returning.
>
> Signed-off-by: Iago Toral Quiroga <itoral@...lia.com>
> Signed-off-by: Eric Anholt <eric@...olt.net>
> Link: https://patchwork.freedesktop.org/patch/msgid/20190916071125.5255-1-itoral@igalia.com
> Fixes: a783a09ee76d ("drm/v3d: Refactor job management.")
> Reviewed-by: Eric Anholt <eric@...olt.net>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
You're double freeing with this patch, the bug is already solved.
> ---
> drivers/gpu/drm/v3d/v3d_gem.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
> index 19c092d75266b..6316bf3646af5 100644
> --- a/drivers/gpu/drm/v3d/v3d_gem.c
> +++ b/drivers/gpu/drm/v3d/v3d_gem.c
> @@ -565,6 +565,7 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
> ret = v3d_job_init(v3d, file_priv, &bin->base,
> v3d_job_free, args->in_sync_bcl);
> if (ret) {
> + kfree(bin);
> v3d_job_put(&render->base);
> kfree(bin);
> return ret;
> --
> 2.25.1
>
Powered by blists - more mailing lists