Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/v3d: don't leak bin job if v3d_job_init fails.

If the initialization of the job fails we need to kfree() it
before returning.

Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Eric Anholt <eric@anholt.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@anholt.net>

authored by

Iago Toral Quiroga and committed by
Eric Anholt
0d352a3a 69b22f51

+1
+1
drivers/gpu/drm/v3d/v3d_gem.c
··· 563 563 ret = v3d_job_init(v3d, file_priv, &bin->base, 564 564 v3d_job_free, args->in_sync_bcl); 565 565 if (ret) { 566 + kfree(bin); 566 567 v3d_job_put(&render->base); 567 568 return ret; 568 569 }