From: Iago Toral Quiroga <ito...@igalia.com> [ Upstream commit 0d352a3a8a1f26168d09f7073e61bb4b328e3bb9 ]
If the initialization of the job fails we need to kfree() it before returning. Signed-off-by: Iago Toral Quiroga <ito...@igalia.com> Signed-off-by: Eric Anholt <e...@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/20190916071125.5255-1-ito...@igalia.com Fixes: a783a09ee76d ("drm/v3d: Refactor job management.") Reviewed-by: Eric Anholt <e...@anholt.net> Signed-off-by: Sasha Levin <sas...@kernel.org> --- 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 19c092d75266..6316bf3646af 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.20.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel